Hi everyone,
I've recently started exploring Filament and have encountered a challenge that I haven't been able to resolve despite trying numerous solutions from forums and documentation. Here's a simplified version of my code:
public static function form(Form $form): Form
{
return $form->schema([
Grid::make(3)->schema([
TextInput::make('name')->required()->label('Name'),
Select::make('contact_id')->required()->searchable()
->options(function () {
return User::role('ContactPerson')->pluck('name', 'id');
}),
DateTimePicker::make('start_time')->required()->prefixIcon('heroicon-m-clock')->format('Y-m-d H:i')->seconds(false),
Textarea::make('description')->columnSpan(3)->nullable(),
Section::make()->schema([
Repeater::make('taskGroups')->relationship('taskGroups')->schema([
Grid::make(6)->schema([
Select::make('worker_id')->columnSpan(1)->relationship('worker', 'name'),
DateTimePicker::make('start_time')
->format('Y-m-d H:i')
->default(function (callable $get) {
return $get('../../start_time');
})->reactive(),
]),
])->columns(1)->deletable(false)->addable(false)->minItems(0)->defaultItems(1)->label('')
]),
]),
]);
}
What I am trying to achieve is to have the date and time set at the beginning to be copied into the "DateTimePicker" within the "Repeater" section. Despite various attempts, I haven't been able to get it to work.
Any help or guidance would be greatly appreciated!
Thank you in advance for your support.