In this tutorial, we will learn Laravel 7/6 Get Current User Example

In this tutorial, We will learn how to get current user data in the laravel 7/6 application. 



There are two ways to get the current user data in laravel 6 application


Auth Helper:

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


Auth Facade:

$user = Auth::user();
var_dump($user->id);
var_dump($user->name);
var_dump($user->email);

May this example help you