Skip to content

Commit

Permalink
Merge pull request #16 from coralsio/fix-corals-form
Browse files Browse the repository at this point in the history
fix: use the multiselect incase multiple
  • Loading branch information
marwan-corals authored Mar 2, 2024
2 parents 78a4346 + ce54cb3 commit 730ad7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Corals/core/Foundation/Classes/CoralsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ public function input($key, $label = '', $required = false, $value = null, $attr
$options = \Arr::pull($attributes, 'options', []);

if (in_array($type, $this->selectTypes)) {
$input = html()->select($key, $options, $value)->attributes(array_merge([], $attributes));
if (isset($attributes['multiple'])) {
$input = html()->multiselect($key, $options, $value)->attributes(array_merge([], $attributes));
} else {
$input = html()->select($key, $options, $value)->attributes(array_merge([], $attributes));
}
} elseif (in_array($type, $this->skipValueTypes)) {
$input = html()->{$type}($key)->attributes(array_merge([], $attributes));

Expand Down

0 comments on commit 730ad7a

Please sign in to comment.