Modify data before saving on livewire

how can i modify the form data before it is submited using form build with livewire.
2 Replies
cheesegrits
cheesegrits2y ago
You mean on your own component, not in a resource in a panel? In your save method you can do what you want with the data you get from $this->form->getState() before you save it to your model. If you are working in an admin panel with resource, you can ad a mutateDataBeforeSave() method to the Create/Edit page. https://filamentphp.com/docs/3.x/panels/resources/editing-records/#customizing-data-before-saving
code eater
code eaterOP2y ago
Oh, okay. Thanks

Did you find this page helpful?