getDto(); $expires = now()->addSeconds(config('captcha.waiting_for_captcha_verification_in_seconds')); $result = $this->captchaService->createKeyWithCaptcha($captchaPublicToken, $expires); if (!$result->isSuccess()) { return response()->json($result->getData())->setStatusCode($result->getCode()); } return response()->json(new Captcha($result)); } public function checking(CheckingRequest $request): JsonResponse { $maxCountError = config('captcha.validate_max_count_errors'); $params = $request->getDto(); $result = $this->captchaService->checking($params, $maxCountError); if (!$result->isSuccess()) { return response()->json($result->getData())->setStatusCode($result->getCode()); } return response()->json(new CaptchaVerified($result)); } }