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

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -