@props([
'label' => null, // The group heading/question
'name' => null, // Input name attribute
'options' => [], // ['value' => 'Label']
'selected' => null, // Pre-checked value
'inline' => false, // Horizontal layout toggle
'idPrefix' => 'radio-' . \Illuminate\Support\Str::random(4),
'required' => false
])
{{-- Fixed: Do not merge raw attributes onto the wrapper. Livewire attributes like wire:model must only attach to inputs. --}}
{{-- Group Label/Question --}}
@if($label || $slot->isNotEmpty())
@endif
@foreach($options as $value => $optionLabel)
@php $uniqueId = $idPrefix . '-' . $loop->index; @endphp
{{-- Valid attributes automatically drop down onto this input --}}
whereDoesntStartWith(['class', 'name', 'id']) }}
>
@endforeach
{{-- Validation Error Support --}}
@error($name)
{{ $message }}
@enderror