@props([ 'label' => null, 'options' => [], 'icon' => null, 'prepend' => null, 'append' => null, 'size' => null, 'help' => null, 'model' => null, 'debounce' => null, 'lazy' => false, ]) @php if ($debounce) $bind = 'debounce.' . (ctype_digit($debounce) ? $debounce : 150) . 'ms'; else if ($lazy) $bind = 'lazy'; else $bind = 'defer'; $wireModel = $attributes->whereStartsWith('wire:model')->first(); $key = $attributes->get('name', $model ?? $wireModel); $id = $attributes->get('id', $model ?? $wireModel); $prefix = null; $list = $attributes->get('list', $key . '_list'); $attributes = $attributes->class([ 'form-control', 'form-control-' . $size => $size, 'rounded-end' => !$append, 'is-invalid' => $errors->has($key), ])->merge([ 'list' => $list, 'id' => $id, 'wire:model.' . $bind => $model ? $prefix . $model : null, ]); @endphp
@foreach($options as $option)