Answers for "laravel select update all"

PHP
19

laravel update from query

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

how to update all row in laravel

DB::table('table')->update(['column' => 1]);

Model::query()->update(['confirmed' => 1]);
Posted by: Guest on February-07-2021
4

laravel where update query

DB::table('users')
        ->where('id', $id)
        ->update([
            'status'     => 1
        ]);
Posted by: Guest on August-25-2021

Browse Popular Code Answers by Language