F
Filament7mo ago
Fossil

Call function on save?

Need to call a syncRoles() function inside User model after editing a user. Preferably only when roles_id changed but could call it always on save. How would I do so?
1 Reply
Fossil
Fossil7mo ago
Oh I am blind. Was on the wrong version too. afterSave() I guess but can I call this from a slide over? And how would I get the saved record.
Tables\Actions\EditAction::make()->slideOver()->after(function (User $record, Role $role) {
}
Tables\Actions\EditAction::make()->slideOver()->after(function (User $record, Role $role) {
}