Skip to content

Commit

Permalink
Document chunk.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 23, 2015
1 parent 2abdb3e commit 88b1ecd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@ The database query builder provides a convenient, fluent interface to creating a
var_dump($user->name);
}

#### Chunking Results From A Table

DB::table('users')->chunk(100, function($users)
{
foreach ($users as $user)
{
//
}
});

You may stop further chunks from being processed by returning `false` from the `Closure`:

DB::table('users')->chunk(100, function($users)
{
//

return false;
});

#### Retrieving A Single Row From A Table

$user = DB::table('users')->where('name', 'John')->first();
Expand Down

0 comments on commit 88b1ecd

Please sign in to comment.