Using eloquent model User
, how can we increment 2 columns on the same row by 1 (in a single statement)?
This single statement works but only for incrementing a single column:
User::where('id',$userId)->increment('column1');
These following two attempts did not work:
User::where('id',$userId)->increment('column1')->increment('column2');
User::where('id',$userId)->increment(['column1','column2']);
Any ideas how to solve this in a single statement?