Filament Form + Livewire: Updating Field Without Saving to Database
I’m working with Filament v3 and Livewire v3 and trying to dynamically update a form field without saving to the database.
Scenario:
• I have a HasManyRepeater inside a Filament resource (WordSetResource).
• Each word has an example field that should be generated using OpenAI when a button is clicked.
• The example field should update in the form, but not persist to the database until the user submits.

4 Replies
maybe something like...
Action::make('example')
->label('Generate Example")
->action(function ($livewire) {
$form = $livewire->form->getState();
$form["example"] = "example text";
$livewire->form->fill($form);
}),
add:
to the fields you do not want to save.
Is that
use Filament\Forms\Components\Actions\Action
? I get an error Filament\Forms\ComponentContainer::Filament\Forms\Concerns\{closure}(): Argument #1 ($component) must be of type Filament\Forms\Components\Component, Filament\Forms\Components\Actions\Action given
I am reading here:
https://filamentphp.com/docs/3.x/forms/advanced#inserting-livewire-components-into-a-form
And I can't figure out how to access unsaved fields from the form in my livewire component