url(); state([ 'participant' => null, 'userData' => null, 'receiverPrompt' => null, 'receiverUserData' => null, 'prompt' => '', 'isEditing' => false, ]); rules([ 'prompt' => 'required|string|min:3', ]); mount(function () { if ($this->token) { $this->participant = Participant::findByToken($this->token); if ($this->participant) { $this->userData = $this->participant->getUserData(); $this->prompt = $this->participant->prompt ?? ''; if($this->participant->receiver) { $this->receiverPrompt = $this->participant->receiver->prompt; $this->receiverUserData = $this->participant->receiver->getUserData(); } } } }); $save = function () { if ($this->participant) { $this->validate(); $this->participant->prompt = $this->prompt; $this->participant->save(); $this->isEditing = false; } }; $cancel = function () { $this->prompt = $this->participant->prompt ?? ''; $this->isEditing = false; }; ?>
Your prompt is: {{ $prompt ?: 'No prompt set yet.' }}
{{ $participant->giving_id }}
@if($receiverUserData)You're in a bind!
@elseYou haven't been assigned anyone.
@endif @endif