Problem
Laravel's method Auth::check()
is returning false
in the __construct
method of my controller but its returning true
in any other method used (While i'm logged in of course). I'm assuming the Auth facade isn't quite ready for use when the program hits the __construct
method? Or something like that.
For reference Request::path()
is working correctly in the same place that Auth::check()
returns false.
Examples
public function __construct()
{
dd(Auth::check()); // Returns False
dd(Request::path()); // Returns full path as expected
}
public function dashboard()
{
dd(Auth::check()); // Returns True
}
Question
How do I make Laravels Auth -> 'Illuminate\Support\Facades\Auth'
available for use in the __construct
method of my controller.