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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -