Skip to content

[13.x] Fix dynamic calls to incrementEachQuietly and decrementEachQuietly#60737

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
daffa-aditya-p:fix/dynamic-call-increment-each-quietly
Jul 13, 2026
Merged

[13.x] Fix dynamic calls to incrementEachQuietly and decrementEachQuietly#60737
taylorotwell merged 1 commit into
laravel:13.xfrom
daffa-aditya-p:fix/dynamic-call-increment-each-quietly

Conversation

@daffa-aditya-p

Copy link
Copy Markdown
Contributor

incrementEachQuietly() and decrementEachQuietly(), added in #60720, are declared protected but were never added to the list of methods Model::__call() runs on the model instance. Calling them dynamically therefore forwards to the query builder, which has no such method, and throws a BadMethodCallException:

$user->incrementEachQuietly(['votes' => 1]); // BadMethodCallException

Their siblings (increment, decrement, incrementQuietly, decrementQuietly, incrementEach, decrementEach) are all already listed, so this adds the two missing quiet-each variants.

Also added regression tests that call both methods dynamically on a real model instance — the existing tests only went through public wrapper methods, which bypass __call and left this uncovered.

…:__call

These two methods were added recently (laravel#60720) as protected, but were
not included in the list of methods that Model::__call forwards to the
instance. Calling them dynamically on a model -- e.g.
\->incrementEachQuietly(['votes' => 1]) -- was therefore forwarded
to the query builder, which has no such method, and threw a
BadMethodCallException. Every sibling (increment, decrement,
incrementQuietly, decrementQuietly, incrementEach, decrementEach) is
already listed; this adds the two missing quiet-each variants.
@taylorotwell taylorotwell merged commit 34da7b5 into laravel:13.x Jul 13, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants