Skip to content

Commit

Permalink
Merge pull request laravel#1475 from JosephSilber/remove-fetch
Browse files Browse the repository at this point in the history
Remove array_fetch
  • Loading branch information
taylorotwell committed May 28, 2015
2 parents 44eb96c + 3961f28 commit 0ec7394
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -153,20 +152,6 @@ The `array_except` method removes the given key / value pairs from the array:

// ['name' => 'Desk']

<a name="method-array-fetch"></a>
#### `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'];

<a name="method-array-first"></a>
#### `array_first()` {#collection-method}

Expand Down Expand Up @@ -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'];

<a name="method-array-pull"></a>
#### `array_pull()` {#collection-method}
Expand Down

0 comments on commit 0ec7394

Please sign in to comment.