Few days ago laravel launch 5.5 version and there are lot's of new changes and new feature. In this example i will let you know how to get current logged in user details like id, email, name etc. laravel doesn't change for getting current logged in user details.
So, we can get current user details using laravel auth. You can also use simple auth helper or Auth facade. So i will give you both example, you can take any one as you want. So let's see both examples one by one.
Using Helper:
$user = auth()->user();
print($user->id);
print($user->name);
print($user->email);
Using Facade:
$user = Auth::user();
print($user->id);
print($user->name);
print($user->email);
I hope you found your solution...
Do you like below Tutorials ?
- Angular Use CKEditor Example Tutorial
- How to Use Multiple Select Dropdown in Laravel?
- Angular 9 Image Upload with Crop Example
- Files Upload on Button Click in PHP Dropzone Example
- PHP Dropzone Allow only One File to Upload Example
- PHP Dropzone Allow only Images to Upload Example
- PHP Dropzone Delete Uploaded File Example
- Livewire CRUD Laravel 7 Example