Skip to content

How do I do something when an entry is updated? #1213

Closed Answered by backpack-ai-bot bot
backpack-operations asked this question in Q&A (Help)
Discussion options

You must be logged in to vote

There are several ways to perform additional actions when an entry is updated in Backpack. Here are some options:

  1. 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:

    use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation { update as traitUpdate; }
    
    public function update()
    {
        // Do something before update
        $response = $this->traitUpdate();
        // Do something after update
        return $response;
    }

    Source: Update Operation Documentation

  2. Use Laravel Events:
    You can use Laravel's built-in events in your setupUpdateOperation() method:

    public function setupUpda…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@backpack-operations
Comment options

Answer selected by backpack-operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant