Skip to content

Commit

Permalink
Document the lists method.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 29, 2013
1 parent 2a7ed61 commit eae50bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ The database query builder provides a convenient, fluent interface to creating a

$name = DB::table('users')->where('name', 'John')->pluck('name');

**Retrieving A List Of Column Values**

$roles = DB::table('roles')->lists('title');

This method will return an array of role titles, keyed by the role ID. You may also specify a custom key:

$roles = DB::table('roles')->lists('title', 'name');

**Specifying A Select Clause**

$users = DB::table('users')->select('name', 'email')->get();
Expand Down

0 comments on commit eae50bd

Please sign in to comment.