php - Laravel 4 - Handling 404s With Custom Messages -
according laravel 4 docs can throw 404 custom response:
app::abort(404, 'my message');
i can handle of 404s custom page:
app::missing(function($exception) { return response::view('errors.missing', array(), 404); });
how can pass 'my message' through view in same way generic laravel error page does.
thanks!
you can catch message through exception parameter
app::missing(function($exception) { $message = $exception->getmessage(); $data = array('message', $message); return response::view('errors.missing', $data, 404); });
note: code can reduced, wrote sake of clarity.
Comments
Post a Comment