venerdì 1 agosto 2014

Laravel 404 on Exception

When your application raise an exception you could avoid the "Whoops, looks like something went wrong." by redirect your application to a custom route (ex 404).
Add this snippet in app/start/global.php file in the App::error() section
App::error(function(Exception $exception, $code)
{
    Log::error($exception);
 
    if (Config::get('app.debug') == false) {
        return Redirect::route('404');
    }
});

Nessun commento:

Posta un commento