
How to get user information using hootlex/laravel-friendships package in laravel
How to get user information using hootlex/laravel-friendships package in laravel
In this article, we will see how to solve "How to get user information using hootlex/laravel-friendships package in laravel".
You can get the user information using hootlex/laravel-friendships package in laravel. Sometimes we want to access user information like name, image to display in view file in that case it helps you to access users table column data.-
Laravel friendship get user information using hootlex/laravel-friendships
{{ $invitation->sender->name }} //Get all the invitations for friendship from other users using getFriendRequests() method $invitations = Auth::user()->getFriendRequests(); return view('home')->with(['invitations'=>$invitations]); //Display user information in view file //resources\views\home.blade.php @foreach($invitations as $invitation) {{ $invitation->sender->name }} @endforeach
This code snippet helps you to get the user information like user id, name and others field value from users table who send the invitations for connect to logged in user.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Laravel
- Array to string conversion laravel Controller
- How to get IP address in laravel
- On delete set foreign id column value null using migration in laravel 8
- Multiple Level eager loading in Laravel
- How to display order by null last in laravel
- Pass variable from blade to controller Laravel
- How to get all posts which contains comments in laravel
- Global scope in Laravel with example
- Comment .env file in laravel
- FirstOrCreate() Not Inserting Model
- How to create laravel project using composer
- How to check relationship is loaded or not in Laravel
- How to include header file in laravel
- If no route matched route::fallback in laravel
- How to create pivot table in laravel using migration
- Trying to get property 'title' of non-object
- Call to a member function pluck() on array
- Method chaining in Laravel
- The use statement with non-compound name 'DB' has no effect
- Print last executed query in laravel
- How to insert ckeditor data into database in Laravel?
- Convert multidimensional array to single array in Laravel
- SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
- Ajax POST request in laravel
- How to return error message from controller to view in laravel