Answers for "how to setup 404 laravel"

PHP
2

404 page in laravel

//step 1 ) create the errors/404.blade.php in view.

// step 2 ) go to Handler.php and replace the render function to belwo function.
  public function render($request, Throwable $exception)
    {
        if ($exception instanceof AccessDeniedHttpException) {
            return response(view('errors.404'), 404);
        }
        return parent::render($request, $exception);
    }
Posted by: Guest on March-17-2021
1

custom 404 page in laravel

A very simple one
  
  php artisan vendor:publish --tag=laravel-errors
Posted by: Guest on July-02-2021

Browse Popular Code Answers by Language