Explorar o código

Update Profile model, add hasFollowRequestById method

Daniel Supernault %!s(int64=6) %!d(string=hai) anos
pai
achega
a5a5224d0d
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      app/Profile.php

+ 7 - 0
app/Profile.php

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