Skip to content

Commit

Permalink
Move increment / decrement to update section.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 8, 2014
1 parent 9d09cc0 commit e806ccc
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,20 +216,6 @@ Sometimes you may need to use a raw expression in a query. These expressions wil
->groupBy('status')
->get();

#### Incrementing or decrementing a value of a column

DB::table('users')->increment('votes');

DB::table('users')->increment('votes', 5);

DB::table('users')->decrement('votes');

DB::table('users')->decrement('votes', 5);

You may also specify additional columns to update:

DB::table('users')->increment('votes', 1, array('name' => 'John'));

<a name="inserts"></a>
## Inserts

Expand Down Expand Up @@ -265,6 +251,20 @@ If the table has an auto-incrementing id, use `insertGetId` to insert a record a
->where('id', 1)
->update(array('votes' => 1));

#### Incrementing or decrementing a value of a column

DB::table('users')->increment('votes');

DB::table('users')->increment('votes', 5);

DB::table('users')->decrement('votes');

DB::table('users')->decrement('votes', 5);

You may also specify additional columns to update:

DB::table('users')->increment('votes', 1, array('name' => 'John'));

<a name="deletes"></a>
## Deletes

Expand Down

0 comments on commit e806ccc

Please sign in to comment.