increment single column laravel

Solutions on MaxInterview for increment single column laravel by the best coders in the world

showing results for - "increment single column laravel"
Jaden
12 Jan 2017
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    ]);