How to get logged in user data in Laravel 5?By Hardik Savani | May 25, 2016 | | 6288 Viewer | Category : Laravel
Share this post:
If you are beginner or don't know how to get logged in user details in laravel 5 application then you can do it using laravel auth helper. Laravel can get current login user data both way one using auth helper and another Auth facade. In this post you can learn how to get current logged user id. so first yo
Get Logged User Data using helper
you can get login user details using auth() helper, it will return object of users details.
$user = auth()->user();
Get Logged User ID using helper
$id = auth()->user()->id;
Get Logged User Data using facade
you can get login user details using Auth facade, it will also return object of users data.
$user = Auth::user();
Get Logged User ID using facade
$id = Auth::user()->id;
- Laravel 5.2 - User ACL Roles and Permissions with Middleware using entrust from Scratch Tutorial
- Laravel 5 Facebook authentication using Socialite Package
- Select only one checkbox at a time using Jquery
- Laravel 5 manual pagination with array example
- Autocomplete with images and custom html code in Jquery UI?
- Pixel tracking code php example
- How to disable model timestamps in Laravel 5.3?
- AngularJS - How to render HTML value in ng-repeat ?