CreateRecord equivalency for EditRecord - mutateFormDataBeforeFill
In the
EditRecord
i use the mutateFormDataBeforeFill:
So how to do it in the CreateRecord
? I've tried to find a similar method, but im not lucky so far π€
I want to do the same, mutate $data
, so it contains 'test' with a valueSolution:Jump to solution
So you want a field to be prefilled when you are on the CreatePage? If so you would use the
->default()
for the given field.
For example TextInput::make('dummy')->default('foo')
Or what exactly is it that you are trying to achieve?...4 Replies
There is a
->mutateFormDataBeforeCreate
though. You can do the same there which will be fun upon creatingyeah, but as the method name says, it mutates form data before create
i already tried it before ur msg
it doesnt work
i need to mutate form data before fill
Solution
So you want a field to be prefilled when you are on the CreatePage? If so you would use the
->default()
for the given field.
For example TextInput::make('dummy')->default('foo')
Or what exactly is it that you are trying to achieve?oh yeah i think that is what im looking for, let me check real quick
yeah, it works
ookay
thanks π