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
cheesegrits16mo 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 eaterOP16mo ago
Oh, okay. Thanks
Want results from more Discord servers?
Add your server