Closed
Description
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.
$user = User::where('shop_id', 1)->first();
$user->decrementEach(['counter' => 1, 'balance' => 100]);
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
User::where('shop_id', 1)->decrementEach(['counter' => 1, 'balance' => 100]); // works correctly
Steps To Reproduce
See description
Metadata
Metadata
Assignees
Labels
No labels