`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:

class Tester extends Model {

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


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

 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 on the EditAction does indeed work and set the model's $name attribute value to Overridden name.
Was this page helpful?