瀏覽代碼

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();
+    }
 }