© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
Daniel Plomp

Refresh/Reload Repeater after record create

I have a Page model that has a MorphMany relation with a Url model. I use the
saved
saved
event when I save a Page model, so that it creates an Url model. This all works okay. Using this mechanism I can create multiple Urls for my Pages and set a primary one.

The problem I have is that when I create a Page, validation is fired. So in the database all is created as it should, but then in my Form it show me the
Url
Url
field which is required. If I close the EditForm, and reopen the record that is previously created, I see that the Repeater has a value. This is the code:

private static function getSectionModelUrls()
{
    return Section::make()
        ->hidden(fn (?Page $record) => $record === null)
        ->collapsible()
        ->collapsed()
        ->heading('Primaire URL en additionele URL\'s')
        ->schema([
            Repeater::make('modelUrls')
                ->orderColumn('order')
                ->relationship('modelUrls')
                ->schema([
                    TextInput::make('url')
                        ->label(__('strings.fields.slug'))
                        ->required(),
                    Toggle::make('is_primary')
                        ->label('Primary')
                        ->default(false),
                ]),
        ]);
}
private static function getSectionModelUrls()
{
    return Section::make()
        ->hidden(fn (?Page $record) => $record === null)
        ->collapsible()
        ->collapsed()
        ->heading('Primaire URL en additionele URL\'s')
        ->schema([
            Repeater::make('modelUrls')
                ->orderColumn('order')
                ->relationship('modelUrls')
                ->schema([
                    TextInput::make('url')
                        ->label(__('strings.fields.slug'))
                        ->required(),
                    Toggle::make('is_primary')
                        ->label('Primary')
                        ->default(false),
                ]),
        ]);
}


I thought that hiding the section initially would solve the problem, but when clicking
Save
Save
in my form, it kind of refreshed the page and shows the section, with a validation error on the Url field. I would like to save the record and then see the repeater appear with the fields that are already in the database.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Edit Action record refresh/reload data
FilamentFFilament / ❓┊help
2y ago
Refresh repeater items after save form
FilamentFFilament / ❓┊help
3y ago
addaction - refresh repeater
FilamentFFilament / ❓┊help
14mo ago
Repeater relationship refresh
FilamentFFilament / ❓┊help
3y ago