I have a Laravel application where I want to get Auth::user
in my model. However, when I do Auth::check()
in the model, it returns false
whereas in the controller it returns true.
protected static function boot()
{
parent::boot();
if (Auth::check()){ //returns false
// do my stuff
}
}