url(); state([ 'participant' => null, 'userData' => 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 ?? ''; } } }); $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; }; ?>
@if($participant) You are... {{ $participant->id }} @if($userData)

{{ $userData['data']['username'] ?? 'Unknown' }}

@endif
@if($isEditing)
@error('prompt') {{ $message }} @enderror
@else

Your prompt is: {{ $prompt ?: 'No prompt set yet.' }}

@endif
@if($participant->giving_id) You are giving to

{{ $participant->giving_id }}

@elseif($participant->desperate)

You're in a bind!

@else

You haven't been assigned anyone.

@endif @endif