From 3961f28e8445b68c8f65e3fc7d717885ee2dd114 Mon Sep 17 00:00:00 2001 From: Joseph Silber Date: Wed, 27 May 2015 23:42:43 -0400 Subject: [PATCH] Remove array_fetch --- helpers.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/helpers.md b/helpers.md index 0eb88f3a9b..a4eeaacb70 100644 --- a/helpers.md +++ b/helpers.md @@ -29,7 +29,6 @@ Laravel includes a variety of "helper" PHP functions. Many of these functions ar [array_divide](#method-array-divide) [array_dot](#method-array-dot) [array_except](#method-array-except) -[array_fetch](#method-array-fetch) [array_first](#method-array-first) [array_flatten](#method-array-flatten) [array_forget](#method-array-forget) @@ -153,20 +152,6 @@ The `array_except` method removes the given key / value pairs from the array: // ['name' => 'Desk'] - -#### `array_fetch()` {#collection-method} - -The `array_fetch` method returns a flattened array containing the values of the specified nested element: - - $array = [ - ['developer' => ['name' => 'Taylor']], - ['developer' => ['name' => 'Abigail']] - ]; - - $array = array_fetch($array, 'developer.name'); - - // ['Taylor', 'Abigail']; - #### `array_first()` {#collection-method} @@ -237,11 +222,14 @@ The `array_only` method will return only the specified key / value pairs from th The `array_pluck` method will pluck a list of the given key / value pairs from the array: - $array = [['name' => 'Desk'], ['name' => 'Chair']]; + $array = [ + ['developer' => ['name' => 'Taylor']], + ['developer' => ['name' => 'Abigail']] + ]; - $array = array_pluck($array, 'name'); + $array = array_pluck($array, 'developer.name'); - // ['Desk', 'Chair']; + // ['Taylor', 'Abigail']; #### `array_pull()` {#collection-method}