Skip to content

Commit 8dfb696

Browse files
authored
Merge pull request #92 from prawn185/prawn185-adding-getPendingCount
Prawn185 Adding get pending count
2 parents a1b00bc + 44951ef commit 8dfb696

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Traits/Friendable.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,16 @@ 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()
357+
{
358+
return $this->getPendingFriendships()->count();
359+
}
360+
351361
/**
352362
* This method will not return Friendship models
353363
* It will return the 'friends' models. ex: App\User

0 commit comments

Comments
 (0)