Skip to content

Instantly share code, notes, and snippets.

@kingpabel
Forked from dominicmartineau/gist:5957140
Last active August 29, 2015 14:28
Show Gist options
  • Save kingpabel/f22649ca19ccfb99ecfe to your computer and use it in GitHub Desktop.
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.
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