Answers for "laravel table update where"

PHP
10

laravel update from query

$affected = DB::table('users')
              ->where('id', 1)
              ->update(['votes' => 1]);
Posted by: Guest on May-07-2020
0

laravel model update table

ModelName::whereId($id)->update($request->all());
Posted by: Guest on August-02-2021
0

create or update laravel

ModelName::whereId($id)->update($request->all());
Posted by: Guest on August-02-2021

Browse Popular Code Answers by Language