Explorar el Código

Update Profile model, add hasFollowRequestById method

Daniel Supernault hace 6 años
padre
commit
a5a5224d0d
Se han modificado 1 ficheros con 7 adiciones y 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();
+    }
 }