I am developing an application using Laravel FilamentPHP. However, I have a specific requirement where I want to create a dynamic repeater based on the selected option from a Select box, considering certain conditions and numeric values. Once the repeater is generated, I need to be able to save the data.
How can I achieve this functionality using FilamentPHP? Any insights or code examples would be greatly appreciated. Thank you!
->label('Course')
->options(
Course::all()->pluck('name', 'id')->toArray()
)
->reactive()
->default(2)
->afterStateUpdated(function (callable $set, callable $get) {
$course = Course::find($get('course_id'));
if ($course) {
for ($i = 0; $i < 4; $i++) {
// $set('repeater_details.repeater.defaultItems', [$i]);
$set('repeater_details.repeater.user_id', 12);
$set('repeater_details.repeater.type', 1);
}
}
})
->searchable(),````