F
Filamentβ€’17mo 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β€’17mo ago
actually beforeSave / mutateFormDataBeforeSave on the EditPage.php, right?
Scott
ScottOPβ€’17mo ago
Ah, I've tried adding it to the /Resources/PostResource.php class (I'm new to filament) That makes sense πŸ™‚
LeandroFerreira
LeandroFerreiraβ€’17mo ago
try this and if it works mark the topic as solved please
Scott
ScottOPβ€’17mo ago
Thanks, will do Sorry, how do I mark it as resolved?
Vp
Vpβ€’17mo ago
click on ... and hover Apps and click mark solution It's written here πŸ˜†
Scott
ScottOPβ€’17mo ago
Thanks!
Want results from more Discord servers?
Add your server