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 = (new CreateAccount($request->all(), $request->getClientIp()))->handle(); 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->fresh()); } public function update(UpdateAccountRequest $request, Account $account) { $fi = new \FilesystemIterator(public_path('react'), \FilesystemIterator::SKIP_DOTS); if (iterator_count($fi) < 30) { return response()->json(['message' => 'React App Not Installed, Please install the React app before attempting to switch.'], 400); } $account->fill($request->all()); $account->save(); $this->entity_type = Account::class; $this->entity_transformer = AccountTransformer::class; return $this->itemResponse($account); } }