Merge pull request #1502 from olivervogel/develop

added lists() method to the fluent documentation
This commit is contained in:
Taylor Otwell 2013-01-05 11:50:51 -08:00
commit e0dfd7c5d3
1 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,12 @@ #### Only selecting certain columns from the database:
$user = DB::table('users')->get(array('id', 'email as user_email')); $user = DB::table('users')->get(array('id', 'email as user_email'));
#### Retrieving an array with the values of a given column:
$users = DB::table('users')->take(10)->lists('email', 'id');
> **Note:** Second parameter is optional
#### Selecting distinct results from the database: #### Selecting distinct results from the database:
$user = DB::table('users')->distinct()->get(); $user = DB::table('users')->distinct()->get();