Update Profile model, add hasFollowRequestById method

This commit is contained in:
Daniel Supernault 2019-07-26 22:47:39 -06:00
parent 5d24b254e5
commit a5a5224d0d
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

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