leave() public method

회원탈퇴 처리를 한다. 회원관련 정보(그룹, 이메일, 등록대기 이메일, 계정)도 동시에 삭제한다.
public leave ( string | string[] $userIds ) : void
$userIds string | string[] 탈퇴할 회원의 회원아이디 목록
return void
コード例 #1
0
 /**
  * delete user
  *
  * @return \Illuminate\Http\RedirectResponse
  * @throws Exception
  */
 public function deleteMember()
 {
     $userIds = Input::get('userId', []);
     XeDB::beginTransaction();
     try {
         $this->handler->leave($userIds);
     } catch (Exception $e) {
         XeDB::rollBack();
         throw $e;
     }
     XeDB::commit();
     return redirect()->back()->with('alert', ['type' => 'success', 'message' => '삭제되었습니다.']);
 }
コード例 #2
0
 /**
  * leave
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\RedirectResponse
  * @throws Exception
  */
 public function leave(Request $request)
 {
     $confirm = $request->get('confirm_leave');
     if ($confirm !== 'Y') {
         $e = new InvalidArgumentException();
         $e->setMessage('약관의 동의가 필요합니다.');
         throw $e;
     }
     $id = $this->user->getId();
     XeDB::beginTransaction();
     try {
         $this->handler->leave($id);
     } catch (\Exception $e) {
         XeDB::rollback();
         throw $e;
     }
     XeDB::commit();
     Auth::logout();
     return redirect()->to('/');
 }