Created
August 5, 2016 07:50
-
-
Save Saberko/7232580f61409332d31e4b55471fb7f6 to your computer and use it in GitHub Desktop.
laravel 5.0 error page redirect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Render the given HttpException. | |
* call 'abort(errcode)' in code | |
* | |
* @param \Symfony\Component\HttpKernel\Exception\HttpException $e | |
* @return \Symfony\Component\HttpFoundation\Response | |
*/ | |
protected function renderHttpException(HttpException $e) | |
{ | |
if (!config('app.debug') && view()->exists('errors.'.$e->getStatusCode())) | |
{ | |
return response()->view('errors.'.$e->getStatusCode(), [], $e->getStatusCode()); | |
} | |
else | |
{ | |
return (new SymfonyDisplayer(config('app.debug')))->createResponse($e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment