Dependent select and datatime picker fields.

i have this line of code for setting the value of datatime picker based on selected field

Select::make('status')
->searchable()
->options([
'published' => 'Published',
'draft' => 'Draft',
])
->live()
->afterStateUpdated(fn (Set $set) => $set('scheduled_at', now()))
->required(),

DateTimePicker::make('scheduled_at')
->rules(['date'])
->displayFormat('d-M-Y h:i A')
->minDate(now())
->required()
->placeholder('Scheduled At'),

perticularly it is not working for the datatime picker if there is any alternative please suggest me and i want both the fields to be visible.
Was this page helpful?