Skip to content

Mutate data before creating #26

Answered by lukas-frey
jesus9314 asked this question in Q&A
Discussion options

You must be logged in to vote

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 edit action, you need to override the editAction() method from the calendar widget class:

public function editAction(): Action
    {
        return parent::editAction()
            ->mutateFormDataUsing(function ($data) {
                // mutate data here
            })
        ;
    }

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
None yet
2 participants