captchaService->generate(); if (!$result->isSuccess()) { return response()->json($result->getData())->setStatusCode($result->getCode()); } return response()->json(new Captcha($result)); } }