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
@@ -123,6 +126,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
123
126
[auth](#method-auth)
124
127
[back](#method-back)
125
128
[bcrypt](#method-bcrypt)
129
+
[blank](#method-blank)
126
130
[broadcast](#method-broadcast)
127
131
[cache](#method-cache)
128
132
[collect](#method-collect)
@@ -136,6 +140,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
136
140
[env](#method-env)
137
141
[event](#method-event)
138
142
[factory](#method-factory)
143
+
[filled](#method-filled)
139
144
[info](#method-info)
140
145
[logger](#method-logger)
141
146
[method_field](#method-method-field)
@@ -155,6 +160,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
155
160
[today](#method-today)
156
161
[throw_if](#method-throw-if)
157
162
[throw_unless](#method-throw-unless)
163
+
[transform](#method-transform)
158
164
[validator](#method-validator)
159
165
[value](#method-value)
160
166
[view](#method-view)
@@ -390,6 +396,12 @@ The `array_random()` function returns a random value from an array:
390
396
391
397
// 4 - (retrieved randomly)
392
398
399
+
You may also specify the number of items to return as an optional second parameter. Note that providing this parameter will return an array, even if only one item is desired:
400
+
401
+
$items = array_random($array, 2);
402
+
403
+
// $items: [2, 5]
404
+
393
405
<aname="method-array-set"></a>
394
406
#### `array_set()` {#collection-method}
395
407
@@ -499,6 +511,96 @@ The `array_wrap` function will wrap the given value in an array. If the given va
499
511
500
512
// [0 => 'Laravel']
501
513
514
+
<aname="method-data-fill"></a>
515
+
#### `data_fill()` {#collection-method}
516
+
517
+
The `data_fill` function will fill data in the target array or object where needed, using "dot" notation:
518
+
519
+
$data = ['foo' => 'bar'];
520
+
521
+
data_fill($data, 'baz', 'boom')
522
+
523
+
// ['foo' => 'bar', 'baz' => 'boom']
524
+
525
+
This function also accepts asterisks as wildcards, and will fill into the target accordingly:
0 commit comments