F
Filamentβ€’2y ago
Scott

beforeSave / mutateFormDataBeforeSave on a Resource (v3)

Hi guys, I need to execute some code prior to a record saving (both on initial save and update), but I can't seem to find any documentation for v3 which shows how to do this. I've tried doing what is outlined in the v2 docs, but it doesn't seem to be getting called. I'm adding the beforeSave / mutateFormDataBeforeSave functions in the Resource class for my model. Any ideas what I should be doing here?
6 Replies
LeandroFerreira
LeandroFerreiraβ€’2y ago
actually beforeSave / mutateFormDataBeforeSave on the EditPage.php, right?
Scott
ScottOPβ€’2y ago
Ah, I've tried adding it to the /Resources/PostResource.php class (I'm new to filament) That makes sense πŸ™‚
LeandroFerreira
LeandroFerreiraβ€’2y ago
try this and if it works mark the topic as solved please
Scott
ScottOPβ€’2y ago
Thanks, will do Sorry, how do I mark it as resolved?
Vp
Vpβ€’2y ago
click on ... and hover Apps and click mark solution It's written here πŸ˜†
Scott
ScottOPβ€’2y ago
Thanks!

Did you find this page helpful?