Open bhdrnzl opened 5 years ago
First of all, use this for getting the currently logged in user. Its much clean.
$user = Auth::user();
Secondly, , the getPendingsCount() function was probably removed as I can't find it in the code and I guess the ReadMe was never updated for it.
You can use a function as this one to get the same results (add the following to vendor\hootlex\laravel-friendships\src\Traits\Friendable.php;
public function getPendingFriendsCount($groupSlug = '')
{
$friendsCount = $this->findFriendships(Status::PENDING, $groupSlug)->count();
return $friendsCount;
}
However I have not tested it. Will create a PR when I get home after testing.
-TT
check out your User model you are calling an undefined method
controller;
$user = User::find(Auth::id());
blade;
{{ $user->getPendingsCount() }}
error;
Call to undefined method App\User::getPendingsCount()