> */ protected $dontReport = [ // ]; /** * A list of the inputs that are never flashed for validation exceptions. * * @var array */ protected $dontFlash = [ 'current_password', 'password', 'password_confirmation', ]; /** * Register the exception handling callbacks for the application. * * @return void */ public function register(): void { $this->reportable(function (Throwable $e) { // }); } /** * 处理发现页面找不到之后返回内容 * * @param Request $request 获取请求内容 * @param Throwable $e 抛出错误 * @return Response|JsonResponse|\Symfony\Component\HttpFoundation\Response|RedirectResponse * @throws Throwable */ public function render($request, Throwable $e): Response|JsonResponse|\Symfony\Component\HttpFoundation\Response|RedirectResponse { if ($e instanceof ModelNotFoundException || $e instanceof NotFoundHttpException) { return response()->redirectToRoute('404'); } return parent::render($request, $e); } }