Mutate data before creating #26
|
How to mutate the data before send a form with getSchema method, same way to mutateFormDataBeforeCreate() from filament? |
Answered by
lukas-frey
Aug 10, 2024
Replies: 1 comment
|
You need to override the action, where you want to mutate the data for. So for example, if you want to mutate the form data in the public function editAction(): Action
{
return parent::editAction()
->mutateFormDataUsing(function ($data) {
// mutate data here
})
;
} |
0 replies
Answer selected by
lukas-frey
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to override the action, where you want to mutate the data for. So for example, if you want to mutate the form data in the
editaction, you need to override theeditAction()method from the calendar widget class: