@@ -73,6 +73,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
73
73
[ Arr::prepend] ( #method-array-prepend )
74
74
[ Arr::prependKeysWith] ( #method-array-prependkeyswith )
75
75
[ Arr::pull] ( #method-array-pull )
76
+ [ Arr::push] ( #method-array-push )
76
77
[ Arr::query] ( #method-array-query )
77
78
[ Arr::random] ( #method-array-random )
78
79
[ Arr::reject] ( #method-array-reject )
@@ -959,6 +960,21 @@ use Illuminate\Support\Arr;
959
960
$value = Arr::pull($array, $key, $default);
960
961
```
961
962
963
+ <a name =" method-array-push " ></a >
964
+ #### ` Arr::push() ` {.collection-method}
965
+
966
+ The ` Arr::push ` method pushes an item into an array using "dot" notation. If an array does not exist at the given key, it will be created:
967
+
968
+ ``` php
969
+ use Illuminate\Support\Arr;
970
+
971
+ $array = [];
972
+
973
+ Arr::push($array, 'office.furniture', 'Desk');
974
+
975
+ // $array: ['office' => ['furniture' => 'Desk']]
976
+ ```
977
+
962
978
<a name =" method-array-query " ></a >
963
979
#### ` Arr::query() ` {.collection-method}
964
980
0 commit comments