Skip to content

Instantly share code, notes, and snippets.

@gravitano
Created March 28, 2014 07:23
Show Gist options
  • Select an option

  • Save gravitano/9827152 to your computer and use it in GitHub Desktop.

Select an option

Save gravitano/9827152 to your computer and use it in GitHub Desktop.
404 Error Handling on Laravel 4
App::missing(function()
{
if(Request::ajax())
{
return Response::json([
'code' => 404,
'message' => 'Sorry, that page does not exists.'
], 404);
}
return Response::view('404', [], 404);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment