Laravel 4 - Handling 404s With Custom Messages
问题 According to Laravel 4 docs I can throw a 404 with a custom response: App::abort(404, 'My Message'); I can then handle all of my 404s with a custom page: App::missing(function($exception) { return Response::view('errors.missing', array(), 404); }); How can I pass 'My Message' through to the view in the same way that the generic Laravel error page does. Thanks! 回答1: You can catch your message through the Exception parameter App::missing(function($exception) { $message = $exception->getMessage(