Get userid, username & useremail in laravel

Friends, when we log in to Laravel, the level authentication system stores some of our details and if we want to get those details, like sometimes we need the user name from the user details, we need the user email, we need the user ID, then how can we get it, today we will learn that method.

$id = Auth::user()->id;
$email = Auth::user()->email;
{{auth()->user()->name}}

Leave a Reply