Override the default Error page

Submitted by Mahmoud_Zalt - 9 years ago

replace this in the start/global.php file:

App::error(function($exception, $code)
{
    // log the error
    Log::error($exception);

    // check environment
    if(App::environment() != 'development'){
        switch ($code)
        {
            case 404:
                $message = Lang::get('errors.404');
                break;
            case 500:
                $message = Lang::get('errors.500');
                break;
            default:
                $message = Lang::get('errors.default');
        }

        return View::make('pages.errors.default')
            ->with('error', $code)
            ->with('message', $message);
    }

});