callApiService = $callApiService; } public function index() { return view('views.auth.member-withdrawal'); } public function store() { $response = $this->callApiService->callApi([ 'url' => 'member-login', 'data' => [ 'Email' => session('member')['Email'], 'Password' => request('password') ] ]); if ($this->callApiService->verifyApiError($response)) { notify()->error('현재 비밀번호를 입력해주세요', 'Error', 'bottomRight'); return redirect()->back(); } $setup = $this->callApiService->callApi([ 'url' => 'setup-get', 'data' => [ 'SetupCode' => 'withdraw-default', ] ]); $withdrawDt = Carbon::now()->addWeeks($setup['ActiveWeeks']); $memberId = session('member')['MemberId']; $memberSecuredAct = $this->callApiService->callApi([ 'url' => 'member-act', 'data' => [ 'Page' => [ [ 'Id' => $memberId, 'WithdrawOn' => $withdrawDt->timestamp, ] ] ], ]); if ($this->callApiService->verifyApiError($memberSecuredAct)) { notify()->error($memberSecuredAct['body'], 'Error', 'bottomRight'); return redirect()->back(); } // notify()->success(_e('Action completed'), 'Success', 'bottomRight'); return redirect()->route('member-logout'); } }