laravel get current user

Posted by w3diy - 5 months ago

Laravel 7/6 Get Current User Example

Auth Helper:

$user = auth()->user();

var_dump($user->id);
var_dump($user->name);
var_dump($user->email);    

using Auth Facade:

$user = Auth::user();

var_dump($user->id);
var_dump($user->name);
var_dump($user->email);