laravel if auth user code example
Example 1: laravel auth user_id
$userId = Auth::id();
Example 2: how to check if there is an authenticated user laravel
if (Auth::check()) { // The user is logged in... }
Example 3: laravel check auth
use Illuminate\Support\Facades\Auth;
if (Auth::check()) {
// The user is logged in...
}