Browse Source

Update Profile model, add hasFollowRequestById method

Daniel Supernault 6 years ago
parent
commit
a5a5224d0d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      app/Profile.php

+ 7 - 0
app/Profile.php

@@ -296,4 +296,11 @@ class Profile extends Model
     {
     {
         return $this->hasMany(Collection::class);
         return $this->hasMany(Collection::class);
     }
     }
+
+    public function hasFollowRequestById(int $id)
+    {
+        return FollowRequest::whereFollowerId($id)
+            ->whereFollowingId($this->id)
+            ->exists();
+    }
 }
 }