null, ]); mount(function ($token) { $this->token = $token; if ($this->token) { $this->participant = Participant::findByToken($this->token); } }); $confirmWithdrawal = function () { $this->js(<<<'JS' if (confirm('Are you sure you want to withdraw from the event? This action cannot be undone.')) { $wire.call('withdraw'); } JS); }; $withdraw = function () { if($this->participant->withdraw()) { $this->js('alert("Withdrawal complete")'); return $this->redirect('/', navigate: true); } else { $this->js('alert("Something went wrong")'); return null; } }; ?>
Withdrawing is permanent, once you withdraw you cannot rejoin.