-
-
Save kingpabel/f22649ca19ccfb99ecfe to your computer and use it in GitHub Desktop.
Laravel 4: How to redirect to 404 page after exception thrown. Simply add a redirect to your 404 page at the end of 'App::error()' into app/start/global.php. You should return to your 404 page only if debug is not enabled.
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
App::error(function(Exception $exception, $code) | |
{ | |
Log::error($exception); | |
if (Config::get('app.debug') == false) { | |
return Redirect::route('404'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment