diff --git a/src/Fieldtypes/HasSelectOptions.php b/src/Fieldtypes/HasSelectOptions.php index 7e1289a3c4..9ce9df0b14 100644 --- a/src/Fieldtypes/HasSelectOptions.php +++ b/src/Fieldtypes/HasSelectOptions.php @@ -52,7 +52,7 @@ public function preProcessIndex($value) { $values = $this->preProcess($value); - $values = collect(is_array($values) ? $values : [$values]); + $values = collect($values)->toArray(); return $values->map(function ($value) { return $this->getLabel($value); @@ -67,7 +67,7 @@ public function preProcess($value) return []; } - $value = is_array($value) ? $value : [$value]; + $value = collect($value)->toArray(); $values = collect($value)->map(function ($value) { return $this->config('cast_booleans') ? $this->castFromBoolean($value) : $value;