6 characters", * type="string" * ) * ) * ) * ), * @OA\Response( * response=200, * description="The Company User response", * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), * @OA\JsonContent(ref="#/components/schemas/CompanyUser"), * ), * @OA\Response( * response=422, * description="Validation error", * @OA\JsonContent(ref="#/components/schemas/ValidationError"), * ), * @OA\Response( * response="default", * description="Unexpected Error", * @OA\JsonContent(ref="#/components/schemas/Error"), * ), * ) */ public function store(CreateAccountRequest $request) { $account = CreateAccount::dispatchNow($request->all(), $request->getClientIp()); if (! ($account instanceof Account)) { return $account; } $ct = CompanyUser::whereUserId(auth()->user()->id); $truth = app()->make(TruthSource::class); $truth->setCompanyUser($ct->first()); $truth->setUser(auth()->user()); $truth->setCompany($ct->first()->company); return $this->listResponse($ct); } }