Add the following method to you existing app/Exception/Handler.php
in order to use resources/views/errors/$STATUS.blade.php
(or fallback to resources/views/errors/default.blade.php
)
/**
* Render the given HttpException.
*
* @param \Symfony\Component\HttpKernel\Exception\HttpException $e
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function renderHttpException(HttpException $e)
{
if (config('app.debug', false)) {
return $this->convertExceptionToResponse($e);
}
$status = $e->getStatusCode();
$view = (view()->exists("errors.{$status}")) ? "errors.{$status}" : "errors.default";
return response()->view($view, ['exception' => $e], $status);
}