increament single column laravel current value 2b 1

Solutions on MaxInterview for increament single column laravel current value 2b 1 by the best coders in the world

showing results for - "increament single column laravel current value 2b 1"
Ana Sofia
11 Jul 2016
1Product::increment('count' , 5); // count + 5
2
3Product::decrement('count', 5); // count - 5
4
5---------------Or-----------------------
6  
7Product::where('product_id', $product->id)
8    ->update([
9      'count'=> DB::raw('count+1'), 
10      'last_count_increased_at' => Carbon::now()
11    ]);