Skip to content

Instantly share code, notes, and snippets.

@haani-niyaz
Created July 11, 2014 08:58
Show Gist options
  • Save haani-niyaz/db083f9cf9629737f7d6 to your computer and use it in GitHub Desktop.
Save haani-niyaz/db083f9cf9629737f7d6 to your computer and use it in GitHub Desktop.
Laravel app error function with view and status code in response
App::error(function(Exception $exception, $code)
{
Log::error($exception->getMessage());
switch ($code) {
case 404:
return Response::view('errors.404',array(), 404);
break;
default:
return Response::view('errors.default');
break;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment