芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Exceptions/Handler.php
renderable(function (ApiException $e, $request) { return response()->json($e, 403); }); $this->reportable(function (Throwable $e) { // }); $this->renderable(function (\Exception $e) { if ($e->getPrevious() instanceof \Illuminate\Session\TokenMismatchException) { return redirect()->route('login'); } }); $this->renderable(function (InvalidSignatureException $e) { return response()->view('errors.link-expired', [], 403); }); } public function report(Throwable $exception) { if (app()->bound('sentry') && $this->shouldReport($exception) && config('services.sentry.enabled')) { app('sentry')->captureException($exception); } parent::report($exception); } /** * Convert a validation exception into a JSON response. * * @param \Illuminate\Http\Request $request * @param \Illuminate\Validation\ValidationException $exception * @return \Illuminate\Http\JsonResponse */ protected function invalidJson($request, ValidationException $exception) { return response()->json([ 'message' => __('validation.givenDataInvalid'), 'errors' => $exception->errors(), ], $exception->status); } public function render($request, Throwable $exception) { if ($exception instanceof TokenMismatchException) { return redirect(route('login'))->with('message', 'You page session expired. Please try again'); } return parent::render($request, $exception); } }