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.
$user = auth()->user();
$user = Auth::user();
I hope you found your solution...
Do you like below Tutorials ?
- How to Open URL in New Tab using Jquery?
- Laravel 7.x and 6.x Routing Tutorial
- Ng Bootstrap Modal in Angular 8 Example
- Bootstrap 4 Datepicker in Angular 9/8 Example
- Disable Registration Route in Laravel
- Bootstrap Timepicker in Angular Example
- Count Number of Pages in PDF - PHP Script
- Digital Signature PHP Script Example