Customer::find($customer_id)->increment('loyalty_points');
// increment by 20
Customer::find($customer_id)->increment('loyalty_points',20);
DB::table('my_table')
->where('rowID', 1)
->update([
'column1' => DB::raw('column1 + 2'),
'column2' => DB::raw('column2 + 10'),
'column3' => DB::raw('column3 + 13'),
'column4' => DB::raw('column4 + 5'),
]);
Product::where('id',$id)
->increment('quantity', 4, ['updated_at' => Carbon::now()]);
or
// Increment by 1
Product::find($product_id)->increment('quantity');
//Increment by entered number "2"
Product::find($product_id)->increment('quantity', 2);
or
// Increment by 1
DB::table('products')->increment('quantity');
//Increment by entered number "2"
DB::table('products')->increment('quantity', 2);