laravel order by 1

laravel order by

$affected = DB::table('users')
              ->where('id', 1)
              ->update(['votes' => 1]);

Here is what the above code is Doing:
1. We’re using the DB facade to access the database.
2. We’re using the table method to specify which table we want to query.
3. We’re using the where method to specify which column we want to check.
4. We’re using the update method to specify which column we want to update.
5. We’re using the votes column to specify the new value.

Similar Posts