create() public method

주어진 정보로 신규회원을 등록한다. 회원정보에 대한 유효성검사도 병행하며, 회원관련 정보(그룹, 이메일, 등록대기 이메일, 계정)도 동시에 추가한다.
public create ( array $data ) : Xpressengine\User\UserInterface
$data array 신규회원 정보
return Xpressengine\User\UserInterface 신규 등록된 회원정보
 /**
  * store user
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\RedirectResponse
  * @throws Exception
  */
 public function store(Request $request)
 {
     $this->validate($request, ['email' => 'email|required', 'displayName' => 'required', 'password' => 'required|password']);
     $userData = $request->except('_token');
     $userData['emailConfirmed'] = 1;
     XeDB::beginTransaction();
     try {
         $this->handler->create($userData);
     } catch (\Exception $e) {
         XeDB::rollback();
         throw $e;
     }
     XeDB::commit();
     return redirect()->route('settings.member.index')->with('alert', ['type' => 'success', 'message' => '추가되었습니다.']);
 }
 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function postRegister(Request $request)
 {
     // validation
     $this->checkJoinable();
     $this->checkCaptcha('join');
     $this->validate($request, ['email' => 'email|required', 'displayName' => 'required', 'password' => 'required|confirmed|password', 'agree' => 'required']);
     // resolve data
     $userData = $request->except('_token', 'agree');
     $userData['rating'] = Rating::MEMBER;
     $userData['status'] = \XeUser::STATUS_ACTIVATED;
     // set default join group
     $config = app('xe.config')->get('user.join');
     $joinGroup = $config->get('joinGroup');
     array_add($userData, 'groupId', []);
     $userData['groupId'][] = $joinGroup;
     unset($userData['password_confirmation']);
     XeDB::beginTransaction();
     try {
         $user = $this->handler->create($userData);
         // if email confirmation enabled, send email for confirm
         if ($this->useEmailConfirm() !== false) {
             $mail = $user->getPendingEmail();
             try {
                 /** @var EmailBrokerInterface $broker */
                 $this->emailBroker->sendEmailForConfirmation($mail);
             } catch (Exception $e) {
                 throw $e;
             }
             XeDB::commit();
             // redirect to email confirm info page
             return redirect()->route('auth.confirm', ['email' => $user->email])->with('alert', ['type' => 'info', 'message' => '회원가입이 정상적으로 처리되었습니다. 회원계정을 활성화하려면 이메일 인증을 하셔야 합니다.']);
         }
     } catch (\Exception $e) {
         XeDB::rollback();
         throw $e;
     }
     XeDB::commit();
     // login and redirect
     $this->auth->login($user);
     return redirect($this->redirectPath());
 }