© 2026 Hedgehog Software, LLC

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

Save to DB after deleting a repeater element

I am implementing a ChatGPT-like UI. I use a Repeater to populate the list of conversations. When I press the delete icon it deletes properly the element from the array but I would have to press Submit to save the modified list into the DB. What I want is to save the array immediately after pressing the Delete button (actually this control ideally doesn't even have a submit button).

I played a bit with deleteAction object (https://filamentphp.com/docs/3.x/forms/fields/repeater#customizing-the-repeater-action-objects) but it seems it can just setup the action in specific ways instead of running code after pressing the delete button.

This is my form:
    protected function getFormSchema(): array
    {
        // dd($this->conversation);
        return [
            FilamentForms\Repeater::make('history')
            ->schema([
                FilamentForms\TextInput::make('name')
                ->readOnly(true)
                ->label('')
            ])
            ->addable(false)
            ->model($this->conversation)
            ->statePath('data')
        ];
    }
    protected function getFormSchema(): array
    {
        // dd($this->conversation);
        return [
            FilamentForms\Repeater::make('history')
            ->schema([
                FilamentForms\TextInput::make('name')
                ->readOnly(true)
                ->label('')
            ])
            ->addable(false)
            ->model($this->conversation)
            ->statePath('data')
        ];
    }
Repeater - Form Builder - Filament
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

save repeater values as json to DB
FilamentFFilament / ❓┊help
2y ago
Repeater rolls back after save
FilamentFFilament / ❓┊help
2y ago
Refresh repeater items after save form
FilamentFFilament / ❓┊help
3y ago
infolist repeater action get element
FilamentFFilament / ❓┊help
2y ago