Skip to content

Commit 92456ee

Browse files
author
Adrián Márquez
committed
deprecated method 'lists', using 'pluck' instead
1 parent 1f93ede commit 92456ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

queries.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ You may stop further chunks from being processed by returning `false` from the `
8888

8989
#### Retrieving A List Of Column Values
9090

91-
If you would like to retrieve an array containing the values of a single column, you may use the `lists` method. In this example, we'll retrieve an array of role titles:
91+
If you would like to retrieve an array containing the values of a single column, you may use the `pluck` method. In this example, we'll retrieve an array of role titles:
9292

93-
$titles = DB::table('roles')->lists('title');
93+
$titles = DB::table('roles')->pluck('title');
9494

9595
foreach ($titles as $title) {
9696
echo $title;
9797
}
9898

9999
You may also specify a custom key column for the returned array:
100100

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

103103
foreach ($roles as $name => $title) {
104104
echo $title;

0 commit comments

Comments
 (0)