How do I do something when an entry is updated? #1213
-
So i have a backpack form, inside the Create and Update operation... i want when an entry is updated... to do something extra... like to set some attributes that don't have fields. How can I do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are several ways to perform additional actions when an entry is updated in Backpack. Here are some options:
These methods allow you to perform additional actions or set attributes that don't have fields when an entry is updated. Choose the one that best fits your specific use case. Relevant sources: FAQs for CRUDs|Operations |
Beta Was this translation helpful? Give feedback.
There are several ways to perform additional actions when an entry is updated in Backpack. Here are some options:
Override the
update()
method:You can override the
update()
method in your CrudController to add custom logic before or after the update operation. Here's an example:Source: Update Operation Documentation
Use Laravel Events:
You can use Laravel's built-in events in your
setupUpdateOperation()
method: