@@ -46,6 +46,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
46
46
[ Arr::crossJoin] ( #method-array-crossjoin )
47
47
[ Arr::divide] ( #method-array-divide )
48
48
[ Arr::dot] ( #method-array-dot )
49
+ [ Arr::every] ( #method-array-every )
49
50
[ Arr::except] ( #method-array-except )
50
51
[ Arr::exists] ( #method-array-exists )
51
52
[ Arr::first] ( #method-array-first )
@@ -79,6 +80,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
79
80
[ Arr::set] ( #method-array-set )
80
81
[ Arr::shuffle] ( #method-array-shuffle )
81
82
[ Arr::sole] ( #method-array-sole )
83
+ [ Arr::some] ( #method-array-some )
82
84
[ Arr::sort] ( #method-array-sort )
83
85
[ Arr::sortDesc] ( #method-array-sort-desc )
84
86
[ Arr::sortRecursive] ( #method-array-sort-recursive )
@@ -389,6 +391,25 @@ $flattened = Arr::dot($array);
389
391
// ['products.desk.price' => 100]
390
392
```
391
393
394
+ <a name =" method-array-every " ></a >
395
+ #### ` Arr::every() ` {.collection-method}
396
+
397
+ The ` Arr::every ` method ensures that all values in the array pass a given truth test:
398
+
399
+ ``` php
400
+ use Illuminate\Support\Arr;
401
+
402
+ $array = [1, 2, 3];
403
+
404
+ Arr::every($array, fn ($i) => $i > 0);
405
+
406
+ // true
407
+
408
+ Arr::every($array, fn ($i) => $i > 2);
409
+
410
+ // false
411
+ ```
412
+
392
413
<a name =" method-array-except " ></a >
393
414
#### ` Arr::except() ` {.collection-method}
394
415
@@ -1063,6 +1084,21 @@ $value = Arr::sole($array, fn (string $value) => $value === 'Desk');
1063
1084
// 'Desk'
1064
1085
```
1065
1086
1087
+ <a name =" method-array-some " ></a >
1088
+ #### ` Arr::some() ` {.collection-method}
1089
+
1090
+ The ` Arr::some ` method ensures that at least one of the values in the array passes a given truth test:
1091
+
1092
+ ``` php
1093
+ use Illuminate\Support\Arr;
1094
+
1095
+ $array = [1, 2, 3];
1096
+
1097
+ Arr::some($array, fn ($i) => $i > 2);
1098
+
1099
+ // true
1100
+ ```
1101
+
1066
1102
<a name =" method-array-sort " ></a >
1067
1103
#### ` Arr::sort() ` {.collection-method}
1068
1104
0 commit comments