Skip to content

Instantly share code, notes, and snippets.

@nesk
Last active January 16, 2018 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nesk/056413c784d59774b68fa8b75d741b16 to your computer and use it in GitHub Desktop.
Save nesk/056413c784d59774b68fa8b75d741b16 to your computer and use it in GitHub Desktop.
Laravel default error page (2/2)
<?php
/**
* Render the given HttpException.
*
* @param \Symfony\Component\HttpKernel\Exception\HttpException $e
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function renderHttpException(HttpException $e)
{
if (! view()->exists("errors.{$e->getStatusCode()}")) {
return response()->view('errors.default', ['exception' => $e], 500, $e->getHeaders());
}
return parent::renderHttpException($e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment