📌  相关文章
📜  laravel 中的 404 页面 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:44.550000             🧑  作者: Mango

代码示例1
//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);
    }