-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incrementEach and decrementEach dont respect where query when used for eloquent model #49009
Comments
Yes that's expected and how these methods work. They're not scoped to the single instance of the model. |
@driesvints Our team had a similar issue with |
+1 Ran into the same problem. The difference in behaviour between |
This was completely unexpected. This made it into prod and I have to restore backups now. |
@driesvints can you please reconsider opening this there is no way this cant be considered a bug without changing the name of the functions to be more obvious. |
Laravel Version
10.32.1
PHP Version
8.1.22
Database Driver & Version
No response
Description
Related: #45577 and #48595, copied the description from that issue:
incrementEach() and decrementEach() dont respect where condition when used for eloquent model.
All users in the table are decremented whatever 'shop_id' they have.
Please note that the problem is only if executed via eloquent model , but works correctly if executed via direct query as below
Steps To Reproduce
See description
The text was updated successfully, but these errors were encountered: