Skip to content

Commit 9d41f71

Browse files
committed
Adding getPendingFriendships as per documentation
1 parent 27b4186 commit 9d41f71

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Traits/Friendable.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,17 @@ public function getMutualFriendsCount($other)
348348
return $this->getMutualFriendsQueryBuilder($other)->count();
349349
}
350350

351+
/**
352+
* Get the number of pending friend requests
353+
*
354+
* @return integer
355+
*/
356+
public function getPendingsCount($other)
357+
{
358+
359+
return $this->getPendingFriendships()->count();
360+
}
361+
351362
/**
352363
* This method will not return Friendship models
353364
* It will return the 'friends' models. ex: App\User

0 commit comments

Comments
 (0)