© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago•
4 replies
steexd

Dynamic Repeater based on FileUpload->multiple() files

Hi everyone!

I’m working on a feature in Filament where I’d like to create a repeater that contains basic metadata fields like title and description. The repeater should automatically generate entries based on the number of files uploaded in a FileUploader field (one entry per file).

Here’s an example of the schema I’m currently working with:
public static function form(Form $form): Form
{
    return $form
        ->schema([

            Section::make(__('Media upload'))
                ->schema([
                    FileUpload::make('filepath')
                        ->label(__('Media'))
                        ->disk('public')
                        ->directory('media')
                        ->required()
                        ->multiple()
                ]),

            Section::make(__('Media details'))
                ->schema([
                    Repeater::make('media_metadata')
                        ->schema([                                   
                              Grid::make()
                                  ->schema([
                                      TextInput::make('title')
                                          ->label(__('Title'))
                                          ->required(),
                                          
                                      Textarea::make('description')
                                          ->label(__('Description'))
                                  ])
                                  ->columns(2)
                        ])
                        ->defaultItems(0)
                        ->reorderable(false)
                        ->deletable(false)
                        ->addable(false)
                ]),
        ]);
}
public static function form(Form $form): Form
{
    return $form
        ->schema([

            Section::make(__('Media upload'))
                ->schema([
                    FileUpload::make('filepath')
                        ->label(__('Media'))
                        ->disk('public')
                        ->directory('media')
                        ->required()
                        ->multiple()
                ]),

            Section::make(__('Media details'))
                ->schema([
                    Repeater::make('media_metadata')
                        ->schema([                                   
                              Grid::make()
                                  ->schema([
                                      TextInput::make('title')
                                          ->label(__('Title'))
                                          ->required(),
                                          
                                      Textarea::make('description')
                                          ->label(__('Description'))
                                  ])
                                  ->columns(2)
                        ])
                        ->defaultItems(0)
                        ->reorderable(false)
                        ->deletable(false)
                        ->addable(false)
                ]),
        ]);
}

Is there a simple or recommended way to achieve this?
Ideally, the repeater field would also update dynamically if files are added or removed from the FileUpload field...

Thanks in advance for your help!
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

Dynamic validation based on Select and FileUpload
FilamentFFilament / ❓┊help
3y ago
Questions based on repeater
FilamentFFilament / ❓┊help
2y ago
Dynamic Repeater
FilamentFFilament / ❓┊help
3y ago
Dynamic Repeater
FilamentFFilament / ❓┊help
3y ago