mardi 4 décembre 2018

Laravel - Auth::check() returns false in Model but returns true in controller

I have a Laravel app where I want to get Auth::user in my Model. But when I do Auth::check() in model it returns false where as in controller it returns true

   protected static function boot()
   {
    parent::boot();

     if(Auth::check()){   //returns false
        -- do my stuff--
    }
   }



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2zIr2Vo
via IFTTT

Aucun commentaire:

Enregistrer un commentaire