I have a radio button; for each choice I make it shows me the input text associated with the choice made on the radio button.
The code below works well; what I am looking for is to put the text input directly under the choice I made and NOT, as happens now, at the end of the entire radio button
<?php
namespace App\Livewire;
class CreateProduct extends Component implements HasForms
{
use InteractsWithForms;
public ?array $data = [];
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name'),
TextInput::make('slug'),
TextInput::make('detail'),
Radio::make('status')
->options([
'draft' => 'Draft',
'scheduled' => 'Scheduled',
'published' => 'Published'
])
->live()
->afterStateUpdated(fn(Radio $component) => $component
->getContainer()
->getComponent('dynamicTypeFieldsRadio')
->getChildComponentContainer()
->fill()),
Grid::make(2)
->schema(fn(Get $get): array => match ($get('status')) {
'draft' => [],
'scheduled' => [
TextInput::make('scheduled_input')
->numeric()
->required()
->prefix('€'),
],
'published' => [
TextInput::make('published_input')
->required()
],
default => [],
})
->key('dynamicTypeFieldsRadio'),
])
->statePath('data');
}
public function render()
{
return view('livewire.create-product');
}
}
Can someone please help me?