How can I get the user model in Laravel like this?
$userModel::find( auth()->id() );
I mean, auth user instance is already loaded, but in what above do we do the request to db...
How can I get the user model in Laravel like this?
$userModel::find( auth()->id() );
I mean, auth user instance is already loaded, but in what above do we do the request to db...
You can get loggedIn user info like below
$user = auth()->user() ? auth()->user() : null;