Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show the 404 page?

I would like to show 404 page in Laravel 5 while MethodNotAllowedHttpException throws.

Can anyone help me in this regard?

like image 533
julious ceazer Avatar asked Dec 04 '22 03:12

julious ceazer


1 Answers

Add this to app/Exceptions/Handler.php:

public function render($request, Exception $e) 
{
    if ($e instanceof MethodNotAllowedHttpException) 
    {
        abort(404);
    }
    return parent::render($request, $e);
}

Then edit resource/views/errors/404.blade.php to personalize the page.

like image 182
Bruno Lebtag Avatar answered Dec 23 '22 23:12

Bruno Lebtag