Problem
When displaying HTTP error pages (404, 500, etc.), I want to keep the standard project of my current project, including the header and footer. My project also includes a registration system. When a user logs in and receives an error message, he will be redirected to the corresponding error page, but Laravel will not recognize that the user is registered . This is because custom error pages (located in resources/views/errors/{code}.blade.php do not start through regular middleware (for some reason).
This behavior has already been reported several times, but no response has been received. The hacking solution is to install the StartSession for each request, but this is not enough for my case.
How can I use Auth / Session middleware on user error pages?
Inappropriate decisions
- I don't want to add
StartSession (or any other) to every request
Related Questions and Links
- Laravel Auth on error pages , Laravel 5.0 custom 404 does not use middleware → The solution did not want
- Laravel 5.2 Auth :: check () on exception pages (layouts) There is no good solution
- GitHub issue that I discovered because I think this behavior is not intentional
php error-handling middleware laravel laravel-5
manniL
source share