
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
- How to display user profile after login in laravel
- Delete records with relationship in laravel
- Laravel migration add foreign key to existing table
- Get current URL on visit URL in Laravel
- Redirect from www to non www in laravel using htaccess
- Method Illuminate\Database\Eloquent\Collection::lists does not exist
- Retrieve count of nested relationship data in Laravel
- How to show data by ID in laravel?
- Laravel route parameter
- How to create projects method with belongstomany relationship in user model
- Recursive function example code PHP Laravel
- On delete set foreign id column value null using migration in laravel 8
- Delete file from amazon s3 bucket using Laravel
- How to pass query string to url in laravel
- Insert current date time in a column using Laravel
- How to use bootstrap pagination in laravel 8
- How to pass variable from controller to model in Laravel
- Touch parent updated_at in Laravel
- How to run a specific seeder class in laravel
- Display message with session flash using bootstrap alert class in laravel
- Validation errors for multiple forms on same page Laravel
- Redirect to previous page or url in laravel
- How to get single column value in laravel
- File_put_contents(/var/www/html/w3code/storage/framework/sessions/CXwN3EXKxERD6jgy3rADcaAAbAx8FRKih2JK7UO9): Failed to open stream: Permission denied
- Store logged in user details in session and display in view in laravel