© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Albert Lens

How to dynamically fill repeater items in create form

Hi. I need to fill several repeater items dynamically.
At the moment, the "empty" lines are being created as expected (I mean 3 or 4 items), but the one only field called "description" is not filled;

My code includes a TableRepeater::make ('actions') and inside there is one only field in the schema, called description.

My code works afterStateUpdated and goes like this:

return $form
            ->schema([
                Fieldset::make()
                    ->schema([
                        TextInput::make('description')
                                ->label(__('description'))
                                ->live()
                                ->afterStateUpdated(function (Set $set, Get $get, $state) {
                                    $misAcciones = [
                                                'action01',
                                                'action02',
                                                'action03'
                                            ];
                                    $set('actions', $misAcciones ?? null);
                                })
return $form
            ->schema([
                Fieldset::make()
                    ->schema([
                        TextInput::make('description')
                                ->label(__('description'))
                                ->live()
                                ->afterStateUpdated(function (Set $set, Get $get, $state) {
                                    $misAcciones = [
                                                'action01',
                                                'action02',
                                                'action03'
                                            ];
                                    $set('actions', $misAcciones ?? null);
                                })


And below is the repeater part:

TableRepeater::make('actions')
                ->relationship()
                ->label(__('actions'))
                ->schema([
                    TextInput::make('description')->required()->label(__('actionTypeDescription'))
                    ->placeholder(__('actionTypeDescription')),
                ])->minItems(2)->reorderable(true)->reorderableWithButtons()->orderColumn('order_column')
                ->addActionLabel('Añadir + Acciones')
                ,
TableRepeater::make('actions')
                ->relationship()
                ->label(__('actions'))
                ->schema([
                    TextInput::make('description')->required()->label(__('actionTypeDescription'))
                    ->placeholder(__('actionTypeDescription')),
                ])->minItems(2)->reorderable(true)->reorderableWithButtons()->orderColumn('order_column')
                ->addActionLabel('Añadir + Acciones')
                ,


Any ideas of how I can fill the field DESCRIPTION inside the repeater called ACTIONS ????

Tks.
image.png
image.png
image.png
Solution
the repeater is an array of arrays.
[
  ['description' => 'blah'],
  ['description' => 'blah2'],
  ...
]
[
  ['description' => 'blah'],
  ['description' => 'blah2'],
  ...
]
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to validate repeater items certain conditions before create - Attributes IN repeater items
FilamentFFilament / ❓┊help
2y ago
Fill repeater in custom form in modal
FilamentFFilament / ❓┊help
3y ago
Dynamically change Form component in Repeater
FilamentFFilament / ❓┊help
2y ago
Refresh repeater items after save form
FilamentFFilament / ❓┊help
3y ago