I'm using a middleware to parse the output of the templates. This is working fine for all pages.
However when I want to show a 404 (got a custom page for that) it doesn't treat it as a http request (that's what I think) since it doesn't go through the middleware.
My question is, how to have ALL requests go through the middleware.
The error pages don't go through the routes.php.
In
Kernel.php
move your middleware from the$routeMiddleware
array to$middleware
array.Middleware in this array will run on every request (tested in 5.1).