Skip to content

Increment\decrement without fire update event #55677

Discussion options

You must be logged in to vote
    protected function incrementQuietly($column, $amount = 1, array $extra = [])
    {
        return static::withoutEvents(
            fn () => $this->incrementOrDecrement($column, $amount, $extra, 'increment')
        );
    }

Use this in model if you don't have that function in your model because of laravel version.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@macropay-solutions
Comment options

Answer selected by mrFANRA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants