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:
3 Replies
Just use a laravel observer?
Or use the lifestyle hook 'after'
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#lifecycle-hooks
I don't know if I can get form data in an observer.
I think you can use
wasChanged
in afterSave hook
https://filamentphp.com/docs/3.x/panels/resources/editing-records#lifecycle-hooks
https://laravel.com/docs/11.x/eloquent#examining-attribute-changesLaravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.