Laravel get logged in user data

2024-03-04 04:39:03 Priyag Laravel

In this trick we are going to see how to get logged in user data in laravel. You can get logged in user data using Auth facade in laravel.

Below is simple Auth facade example


Getting specific key like name, email from Auth Facade

$userInfo->name;  // return name of loggedin user
$userInfo->email;  // returns loggedin user email

This post is submitted by one of our members. You may submit a new post here.

Related Tricks