F
Filamentβ€’10mo ago
Lara Zeus

repeater - anonymous action - fillForm

I have a repeater with anonymous action to open a modal inside a resource as:
Repeater::make('sections')
->label('')
->schema([
TextInput::make('name'),
Actions::make([
Action::make('more-options')
->fillForm(function ($data, $record): array {
dd($data, $record);
return [
'name' => $get('name'),
];
})
->form(function(){
return [
TextInput::make('name')
];
})
->action(function (Set $set, $data) {
$set('name', $data['name']);
}),
]),
])->relationship(),
Repeater::make('sections')
->label('')
->schema([
TextInput::make('name'),
Actions::make([
Action::make('more-options')
->fillForm(function ($data, $record): array {
dd($data, $record);
return [
'name' => $get('name'),
];
})
->form(function(){
return [
TextInput::make('name')
];
})
->action(function (Set $set, $data) {
$set('name', $data['name']);
}),
]),
])->relationship(),
and I want to get the data of the repeater item tried Get $get, $state, $data, $record but I am always getting only the first item in the Repeater when trying to access the record not sure what to inject there in fillForm BTW the same code works just fine when not inside a repeater! any idea?
5 Replies
Lara Zeus
Lara Zeusβ€’10mo ago
Lara Zeus
Lara Zeusβ€’9mo ago
anyone have a work around for this isseu?
Lara Zeus
Lara Zeusβ€’9mo ago
not really πŸ™‚ , I am trying to access the current repeater item not the parent I submitted a bug too, will see 🀞 https://github.com/filamentphp/filament/issues/9348
GitHub
repeater anonymous action not aware with current item state Β· Issue...
Package filament/filament Package Version v3.0.69 Laravel Version 10.26.2 Livewire Version No response PHP Version v3.0.5 Problem description adding anonymous action to a repeater and using fillFor...
Lara Zeus
Lara Zeusβ€’9mo ago
also it's only affect actions other components works fine
Want results from more Discord servers?
Add your server
More Posts