فهرست منبع

Update Profile model, add hasFollowRequestById method

Daniel Supernault 6 سال پیش
والد
کامیت
a5a5224d0d
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  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();
+    }
 }