You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: queries.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -88,17 +88,17 @@ You may stop further chunks from being processed by returning `false` from the `
88
88
89
89
#### Retrieving A List Of Column Values
90
90
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:
92
92
93
-
$titles = DB::table('roles')->lists('title');
93
+
$titles = DB::table('roles')->pluck('title');
94
94
95
95
foreach ($titles as $title) {
96
96
echo $title;
97
97
}
98
98
99
99
You may also specify a custom key column for the returned array:
0 commit comments