dispatch('withdrawal-confirmed'); $this->closeModal(); } public function render() { $contract = app(CustomDomainAccess::class)->contractOf($this->customer()); $right = WithdrawalRight::for($contract); return view('livewire.confirm-withdraw', [ 'right' => $right, // What they would owe for the days the cloud has already run, and // therefore what does NOT come back. Zero where the express request // to start at once was never given — then the whole amount returns, // and the dialog says so. 'owedNetCents' => $contract === null ? 0 : WithdrawalRight::owedNetCents($contract), 'deliveredDays' => $contract === null ? 0 : WithdrawalRight::deliveredDays($contract), 'termDays' => $contract === null ? 0 : WithdrawalRight::termDays($contract), ]); } }