Laravel 5.2 Auth::check() on exception pages (layouts)
问题 When I abort(404) Laravel 5.2 returns an error page. But when I call Auth::check() of Auth::user() through the dump() method it return null. But I want a custom error page with the current logged-in user on the screen (for example in the layouts/app.blade.php I want in the menu: Goodmorning username ). I tried to enable the web middleware on the app/exceptions/handler.php but that didn't work. Anny suggestions? 回答1: You could add custom error message: abort(404, 'ow noo, error 404'.Auth::user