Skip to content

Commit d5aae51

Browse files
authored
Use collect()->partition() to keep L11 support (#939)
1 parent a18cbe4 commit d5aae51

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Models/Traits/Searchable.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ public static function getIndexSettings(): array
6767

6868
private static function filter($type, $initialValue): array
6969
{
70-
[$data, $classes] = Arr::partition(
71-
Eventy::filter('index.' . static::getModelName() . '.' . $type, $initialValue),
72-
fn ($value, $key) => is_string($key)
73-
);
70+
[$data, $classes] = collect(Eventy::filter('index.' . static::getModelName() . '.' . $type, $initialValue))
71+
->partition(fn ($value, $key) => is_string($key));
72+
73+
$data = $data->toArray();
7474

7575
// Execute all the classes and merge their output with the data
76-
collect($classes)
76+
$classes
7777
->map(Arr::wrap(...))
7878
->filter(fn ($class) => count($class))
7979
->each(function ($class) use ($type, &$data) {

0 commit comments

Comments
 (0)