Reputation: 449
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...
Upvotes: 2
Views: 620
Reputation: 3551
You can get loggedIn user info like below
$user = auth()->user() ? auth()->user() : null;
Upvotes: 0
Reputation: 1804
You can just do:
auth()->user();
or using the Auth
facade:
Auth::user();
Upvotes: 2