Last active
April 23, 2019 12:36
-
-
Save adampatterson/e86ac67d321932ecd787f060ae6bdb81 to your computer and use it in GitHub Desktop.
Laravel 5.2 custom 500 error page
This file contains hidden or 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
# /app/Exceptions/Handler.php | |
# use Symfony\Component\Debug\Exception\FlattenException; | |
# public function render($request, Exception $e) | |
$exception = FlattenException::create($e); | |
$statusCode = $exception->getStatusCode($exception); | |
if ($statusCode === 404 or $statusCode === 500 and app()->environment() == 'production') { | |
return response()->view('errors.' . $statusCode, [], $statusCode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment