I'm having problems trying to show a custom 403 page with lumen – the problem sounds like it's very similar to this one.
I have a custom 404 working perfectly, and I've added the "403 code" (below) to the render function of app/Exceptions/Handler.php, but the exception is never caught.
if ($e instanceof AccessDeniedHttpException)
{
return response(view('errors.403'), 403);
}
There definitely wasn't anything straight forward about getting here, but adding 403 stuff to vendor/laravel/lumen-framework/src/Concerns/RegistersExceptionHandlers.php seems to have finally gotten it working.
Here's the modified code, just incase anyone else stumbles into this issue.