© 2026 Hedgehog Software, LLC

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

`mutateFormDataUsing()` not working on CreateAction?

In an Example app with Filament 3.0.7 I've setup a 'Tester' model with just 1 attribute -
$name
$name
:

class Tester extends Model {

    protected $fillable = [
        'name',
    ];
}
class Tester extends Model {

    protected $fillable = [
        'name',
    ];
}


And generated a
TestersResource
TestersResource
for it. Now on the
ListTesters::getHeaderActions()
ListTesters::getHeaderActions()
I'm trying to override the name on save:

 Actions\CreateAction::make()->mutateFormDataUsing( function ( array $data ) {
                $data['name'] = 'Overridden name';

                return $data;
            } ),
 Actions\CreateAction::make()->mutateFormDataUsing( function ( array $data ) {
                $data['name'] = 'Overridden name';

                return $data;
            } ),


The value is then not set in the model when saving. Am I doing something wrong?

However setting the same
mutateFormUsing
mutateFormUsing
on the
EditAction
EditAction
does indeed work and set the model's
$name
$name
attribute value to
Overridden name
Overridden name
.
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

mutateFormDataUsing not working on CreateAction
FilamentFFilament / ❓┊help
3y ago
headerActions: "mutateFormDataUsing" method not working in RelationManager table
FilamentFFilament / ❓┊help
3y ago
RelationManager mutateFormDataUsing
FilamentFFilament / ❓┊help
3y ago
First time pressing the CreateAction button not working
FilamentFFilament / ❓┊help
3y ago