FilamentF
Filamentβ€’3y ago
SirFat

Custom Actions within a Repeater Schema

Hi All,

I'm creating a standalone form outside of a panel which loads a Livewire component of which you can see in one of the screenshots. That part works (mostly) OK.

I'm trying to use a repeater as a mechanism to allow multiple items to be added to a cart/collection. Each items requires customisation that justifies a separate form/modal/slide-over, of which has actions of its own. The result will be fed back to the main Livewire component to display the outcome and invoke a 'onStateChange' which will update the total dollars spent.

When I attempt to embed an 'Action' in the Repeater Schema, it explains that I am passing an 'Action' not a 'Component'. If I encase it in an Actions component, it loops and crashes.

                                    Forms\Components\Section::make("Your SIM Selection")->schema([
                                        Forms\Components\Repeater::make('SIMsToOrder')
                                            ->schema([
                                                 Forms\Components\Actions::make()->schema([ // This causes a loop
                                                        Action::make('configureSIM') // without the above, this complains I am not using a component
                                                            ->modalContent(fn(Action $action): View => view(
                                                                'livewire.sim_configure',
                                                                ['action' => $action],
                                                            ))
                                                     ]),


I've included what the UI looks like now, and a drawing that shows the workflow I am trying to achieve. If anyone has the time and patience to review my 'art' and give me their point of view on approach, that would be fantastic.

🀞 πŸ™
SIM-Repeater-Workflow.png
SIM-Repeater-Progress.png
Solution
Disabled XDebug and this fixed it.
Was this page helpful?