Answers for "increament single column laravel current value + 1"

PHP
1

increament single column laravel current value + 1

Product::increment('count' , 5); // count + 5

Product::decrement('count', 5); // count - 5

---------------Or-----------------------
  
Product::where('product_id', $product->id)
    ->update([
      'count'=> DB::raw('count+1'), 
      'last_count_increased_at' => Carbon::now()
    ]);
Posted by: Guest on September-27-2020

Code answers related to "increament single column laravel current value + 1"

Browse Popular Code Answers by Language