Upon successful login you can get current user details by called
Auth::user() method. It will return null if no user logged in or there is no current user.
On successful login
Auth::user() return value is based on your authentication configuration. If your driver is eloquent then the object return is the class specified by the model settings. generally, it would be User modal.
If your authentication driver is database then the object returned is a generic user. Specifically it’s the
you can access user id or any other columns of user table easily –
Get Current User ID –
Get Current User Email –
Get Current User Name =
That is it.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.