Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel model increase the value by one

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'),
   ]);


$user = User::find($user_id);
$user->cart_count++;
$user->save();
 
PREVIOUS NEXT
Tagged: #laravel #model #increase
ADD COMMENT
Topic
Name
2+6 =