2 "save" actions on CreateResource with "mutateFormDataBeforeCreate"
Hi All,
I'm aware that actions can be added to a Resource. I would like to add an additional "Save" button on the CreateResource page. My goal is to mutate one parameter (e.g., $data['status'] = InternalStatus::CONCEPT) only when this new button is pressed.
Does anyone have any ideas on how to achieve this?
Thanks in advance!
I'm aware that actions can be added to a Resource. I would like to add an additional "Save" button on the CreateResource page. My goal is to mutate one parameter (e.g., $data['status'] = InternalStatus::CONCEPT) only when this new button is pressed.
Does anyone have any ideas on how to achieve this?
Thanks in advance!
Solution
Here is the solution.
Create a Formfield, hide the label and add
For the action, set submit to
This will set status to
If there is another way i would love to see it.
Because this works, but dont think this is the best way of doing this.
Create a Formfield, hide the label and add
hidden as extraAttributesFor the action, set submit to
null and update the $livewire->data['status'] in action and than create the record.This will set status to
Concept in my case.If there is another way i would love to see it.
Because this works, but dont think this is the best way of doing this.