nested repeater with forms Actions Component
I have this stracture and I can't retrieve the cardId on the Action AssignUsers. The record has tasklist model and the arguments is empty. Can Anybody help
Repeater::make('Tasklists')
->relationship('tasklists') // Tells Filament this is a relationship
->schema([
Repeater::make('Cards')
->relationship('cards') // Tells Filament this is a relationship
->schema([...])
->extraItemActions([
Action::make('editCard')
->mountUsing(function (Forms\ComponentContainer $form, $record, array $arguments) {
preg_match_all('/\d+/', $arguments['item'], $cardId);
$cardId = $cardId[0][0];
...
]);
->form([
Split::make([
Section::make([
...
]), Section::make([ Actions::make([ Action::make("Assign Users") ->form([ TextInput::make('name'), ... ]) ->mountUsing(function (Forms\ComponentContainer $form, $record, array $arguments) { }) ]) ])->grow(false), ]) ])
]) ])
]), Section::make([ Actions::make([ Action::make("Assign Users") ->form([ TextInput::make('name'), ... ]) ->mountUsing(function (Forms\ComponentContainer $form, $record, array $arguments) { }) ]) ])->grow(false), ]) ])
]) ])
2 Replies
I think you need to call
$form->fill();
https://filamentphp.com/docs/3.x/actions/modals#executing-code-when-the-modal-opens
or try it on fillForm
its working for me
https://github.com/lara-zeus/bolt/blob/4a6dda579510fcb8e8d0528e4e81b59d0c91bb03/src/Concerns/Schemata.php#L127i use $form->fill(); for filling the form on the main section but i want to get the id on the mountUsing not parsing out from the mountUsing on the form. I did it for the boards but now i can't do it for the cards