讨论数量:
可以在 app/Exceptions/Handler.php
文件中捕获到:
public function render($request, Exception $e) {
if ($e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException)
return response(view('error.404'), 404);
return parent::render($request, $e);
}
@zhuzhichao 写过一篇非常棒的文章:用 Laravel 拥抱异常 https://phphub.org/topics/2460
推荐文章: