Laravel - Query Builder - Update Statements

In addition to inserting records into the database, the query builder can also update existing records using the update method. The update method, like the insert method, accepts an array of column and value pairs indicating the columns to be updated. You may constrain the update query using where clauses:

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