FilamentF
Filament17mo ago
varovas

Do something with record after save

Hi, somehow I did not find a solution for doing something with a record after it was created/updated.

Use case: I want to place a checkbox to a resource form. Then when record was created or updated, I want to check if that checkbox was checked and if it was, I want to create a job operation.

Example:
public function afterSaveHook(Model $model, array $data)
{
    if (isset($data['is_completed']) {
        SendCompletedNotification::dispatch($model);
    }
}
Was this page helpful?