From a5a5224d0dff484c04e55dbf0b15581d0ca51581 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 26 Jul 2019 22:47:39 -0600 Subject: [PATCH] Update Profile model, add hasFollowRequestById method --- app/Profile.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Profile.php b/app/Profile.php index 70ba38ed7..e46bedeed 100644 --- a/app/Profile.php +++ b/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(); + } }