*/ protected $dontFlash = [ 'current_password', 'password', 'password_confirmation', ]; protected $dontReport = [ AdminException::class, RuntimeException::class, ]; /** * Register the exception handling callbacks for the application. */ public function register(): void { $this->renderable(function (RuntimeException $e, Request $request) { return response(['code' => $e->getCode(), 'message' => $e->getMessage()], $e->getHttpStatusCode()); }); } protected function invalidJson($request, ValidationException $exception) { return response()->json([ 'code' => $exception->status, 'message' => $exception->getMessage(), 'errors' => $exception->errors(), ], $exception->status); } }