Laravel 5.7 Get Current UserId UserName and Email

Today, We want to share with you Laravel 5.7 Get Current UserId UserName and Email.In this post we will show you How to get current user details in Laravel 5.7, hear for Laravel 5.7 display logged in user name or email we will give you demo and example for implement.In this post, we will learn about Laravel Profile Login With Email Or Username Display with Edit with an example.

Laravel 5.7 Get Current UserId UserName and Email

There are the Following The simple About Laravel 5.7 Get Current UserId UserName and Email Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel Auth user id in controller, so the get current logged in user id in laravel 5.7 for this example is following below.

Read Also:  vuejs - How to implement Google New reCaptcha with checkbox

Laravel5.7 Get Auth User Information

Using Laravel Facade:

$get_user_details = Auth::user();

Free Live Chat for Any Issue

Using Laravel Helper:

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

Simple You need to use the Auth facade in the Laravel controller;

use Auth;

<h3>laravel 5.7 get current user in controller</h3>
<p>Laravel 5.7 - get Auth user ID in controller with Fetch user data and display that data in Laravel Blade view files.</p>

<b>In Controller:</b>
public function profile()
    $userDtl = Auth::user();
    return view('home')->with(['userDtl' => $userDtl]);

Your Laravel Blade View

<h3>PHP Laravel 5.7 get current user details</h3>
<div class="panel-body">
    Profile user id is: {{ $userDtl->id }}
    Login User first name is: {{ $userDtl->first_name }}
    Login User last name is: {{ $userDtl->last_name }}

laravel 5.7 get id of logged in user

Get Logged User Data using Laravel 5.7 helper

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

Get Laravel 5.7 Logged User ID using helper

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

Laravel 5.7 Get Logged User Data using facade

$userInfo = Auth::user();

Get Logged User ID using Laravel facade

$user_id = Auth::user()->id;

Angular 6 CRUD Operations Application Tutorials

Read :

Read Also:  Laravel Eloquent Get Last Inserted ID using PHP


You can also read about AngularJS, ASP.NET, VueJs, PHP.


I hope you get an idea about Laravel 5.7 Get Current UserId UserName and Email.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.