We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
controller; $user = User::find(Auth::id());
$user = User::find(Auth::id());
blade; {{ $user->getPendingsCount() }}
{{ $user->getPendingsCount() }}
error; Call to undefined method App\User::getPendingsCount()
Call to undefined method App\User::getPendingsCount()
The text was updated successfully, but these errors were encountered:
First of all, use this for getting the currently logged in user. Its much clean. $user = Auth::user();
$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
Sorry, something went wrong.
check out your User model you are calling an undefined method
No branches or pull requests
controller;
$user = User::find(Auth::id());
blade;
{{ $user->getPendingsCount() }}
error;
Call to undefined method App\User::getPendingsCount()
The text was updated successfully, but these errors were encountered: