Where is this code written?
Nov 15, 2023
6
Level 2
Laravel 10 | why laravel doesn't see me as logged in?
The table session says I'm logged in, the lifetime in session.php is 120', and the Jetstream page says I'm logged in. But, none the lines below are able to retrieve $user, why? Thanks
$uid = Auth::id() ; // no static errors
$user = Auth::user(); // no static errors
$user = $request->user(); // no static errors
if (Auth::check()) {$user="logged!";} // runtime: null
if (Auth::id()) {$user="logged!";} // runtime: null
Log::info(var_dump($user)); // Debugbar runtime: null
Level 2
I think I found the problem. Auth::user() actually works, it's the Log that needs to be changed. Thanks everyone.
This doesn't work:
Log::info(var_dump($user));
This works:
Log::info($user);
Please or to participate in this conversation.