mardi 29 décembre 2015

Logged in but Auth::user() always returns null - Laravel 5.1

I have a laravel 5.1 application where I use the default build in Authentication. I'm successfully logged in.

But when I try to use Auth::user() it always returns null. I'm using this code inside a controller. Also using it in a simple route without any custom code returns null.

Route::get('/', function () {
    dd(Auth::user());
});

Session driver is set to file.

Anyone any idea why it always returns null?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire