public function doSignUp(SignUpRequest $request) { $username = $request->get('username'); $email = $request->get('email'); $phone = $request->get('phone'); $password = $request->get('password'); $nickname = $request->has('nickname') ? $request->get('nickname') : ''; $verificationCodeForUsername = $request->get('verification_code_for_username'); $verificationCodeForPhone = $request->get('verification_code_for_phone'); $verificationCodeForEmail = $request->get('verification_code_for_email'); if ($username) { throw new NotSupportedException(NotSupportedException::FeatureOnTheWay); } if ($email) { throw new NotSupportedException(NotSupportedException::FeatureOnTheWay); } if ($phone) { throw new NotSupportedException(NotSupportedException::FeatureOnTheWay); } $user = UserManager::signUp($username, $email, $phone, $password); $user->roles()->attach(System::getDefaultRole()); $user->save(); $userInfo = new UserInfo(); $userInfo->user()->associate($user); $userInfo->save(); return $this->buildResponse(trans('api.auth.sign_up.success'), $user); }