diff --git a/src/Components/AjaxSelect/Traits/ItemFactoryTrait.php b/src/Components/AjaxSelect/Traits/ItemFactoryTrait.php index d1995e8..2128a4d 100644 --- a/src/Components/AjaxSelect/Traits/ItemFactoryTrait.php +++ b/src/Components/AjaxSelect/Traits/ItemFactoryTrait.php @@ -30,7 +30,7 @@ protected abstract function handleInvalidValues($value); /** * TODO: cannot handle multiple values * @param $values - * @return mixed + * @return array */ protected function processValues($values) { if ($this->itemFactory === NULL) { @@ -58,7 +58,11 @@ protected function processValues($values) { } $this->setItems($items); + + if (!is_array($values)) { + $values = [ $values ]; + } return $values; } -} \ No newline at end of file +}