auth() method null on Exceptions
问题 I was playing around with Laravel 5.4.23 and i came across this scenario when i hit a 404 page the auth() , auth()->check() , auth()->user() , and those are not initialized thus returning null in views, or anywhere near that. i even went to AppServiceProvider.php class to do some tests, dd(auth()->check()); returns Null in the boot method, even if i'm logged in, which makes 0 sense to me. that means, whenever a users hits a 404 page, navbars and so on will not render the user data like for