public function deleteMember() { $memberIds = Input::get('id', []); XeDB::beginTransaction(); try { $this->handler->leave($memberIds); } catch (Exception $e) { XeDB::rollBack(); throw $e; } XeDB::commit(); return redirect()->back()->with('alert', ['type' => 'success', 'message' => '삭제되었습니다.']); }
public function leave(Request $request) { $confirm = $request->get('confirm_leave'); if ($confirm !== 'Y') { $e = new InvalidArgumentException(); $e->setMessage('약관의 동의가 필요합니다.'); throw $e; } $id = $this->member->getId(); XeDB::beginTransaction(); try { $this->handler->leave($id); } catch (\Exception $e) { XeDB::rollback(); throw $e; } XeDB::commit(); Auth::logout(); return redirect()->to('/'); }