> */ protected $dontReport = [ // ]; /** * A list of the inputs that are never flashed for validation exceptions. * * @var array */ protected $dontFlash = [ 'password', 'password_confirmation', ]; /** * Catch errors with Sentry. */ public function register(): void { $this->reportable(function (Throwable $e) { if (app()->bound('sentry')) { app('sentry')->captureException($e); } }); } /** * Report or log an exception. * * * @return void * * @throws Throwable */ public function report(Throwable $exception) { parent::report($exception); } /** * @param Request $request * @return RedirectResponse|Response * * @throws Throwable */ public function render($request, Throwable $exception) { if ($exception instanceof UnauthorizedException) { abort(401); } if ($exception instanceof TokenMismatchException) { return redirect() ->back() ->withInput($request->except(['password', 'password_confirmation'])) ->with('error', 'The form has expired due to inactivity. Please refresh the page and try again'); } return parent::render($request, $exception); } }