Default selection for radio element - not working!
class FormPaySchedule extends Component implements Forms\Contracts\HasForms
{
use Forms\Concerns\InteractsWithForms;
public $title;
public $type_pay_schedule;
public $pay_schedule;
protected function getFormSchema(): array
{
return[
Wizard::make([
Wizard\Step::make('paso 1')
->schema([
Card::make([
Radio::make('type_pay_schedule')->label('')
->options([
'option1' => 'by employee',
'option2' => 'everyone employees',
])
->descriptions([
'option1' => 'A',
'option2' => 'B',
])
->default('option1')
->required(),
])
]),
...
5 Replies
I'm using something like this in the cases where
default()
doesn't work:
will not work in edit record page
thanks you
Add:
Then
default()
will workthanks to all