Level 104
If you want it to be live then add the live modifier to wire:model
<input
type="radio"
id="{{ 'type-'.$type }}"
wire:model.live="selection"
value="{{ $type }}"
>
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I have this code.
<div class="flex flex-col gap-1">
<x-form.label>Type</x-form.label>
@foreach (['list', 'image'] as $type)
<fieldset class="ml-2 flex items-center gap-2">
<input type="radio" id="{{ 'type-'.$type }}" wire:model="selection" value="{{ $type }}">
<label for="{{ 'type-'.$type }}">{{ $type }}</label>
</fieldset>
@endforeach
Selection : {{ $selection }}
</div>
When I click on a radio button, the $selection value doesn't change.
Why ?
It should change !
Thanks for your help.
V
If you want it to be live then add the live modifier to wire:model
<input
type="radio"
id="{{ 'type-'.$type }}"
wire:model.live="selection"
value="{{ $type }}"
>
Please or to participate in this conversation.