我要在本地主机上工作时看到错误。
App \ Exceptions \ handler.php
我试过了:
public function render($request, Exception $exception)
{
if ($this->isHttpException($exception) && env('APP_DEBUG') === false) {
return response()->view('errors.404', [], 404);
} else {
return parent::render($request, $exception);
}
}
Run Code Online (Sandbox Code Playgroud)
要么;
if ($this->isHttpException($exception) && App::environment('APP_DEBUG') === false)
Run Code Online (Sandbox Code Playgroud)
我如上所述尝试了它,但是它不起作用。
谢谢。
.env中的APP_DEBUG设置为true