Running something when save changes is clicked.
So I have a page for Products, where a user can edit a products information. I want to be able to pass that info back to stripe to update the product externally so I'd like it to run this process when the Edit product form saves but not quite sure how or where i inject this code.
Appreciate the help!
5 Replies
Assuming you're using a Filament Form, have you explored using
->afterStateUpdated()
? https://filamentphp.com/docs/3.x/forms/advanced#field-updatesThis could work but I kind of need something to run after every save regardless of values changing for specific fields so im not sure if its best suited
So I have found a method for the CreateProduct page,
where I can do things with the data before creating, however I also need this for updating but unsure how todo this still
Solution
use
mutateFormDataBeforeSave()
in the EditProduct pageThat makes sense thank you!
Glad to assist you