@props([ 'name', 'label' => null, 'options' => [], // espera array de arrays: ['id' => ..., 'nombre' => ...] 'values' => [], // valores seleccionados 'placeholder' => 'Seleccionar...', 'searchPlaceholder' => 'Buscar...', ]) @php $values = old($name, $values); // Normalizar opciones: si vienen como strings, los convertimos a ['id'=>..., 'nombre'=>...] $normalizedOptions = collect($options) ->mapWithKeys(function ($option) { if (!is_array($option)) { return [$option => $option]; } return [$option['id'] => $option['nombre']]; }) ->toArray(); @endphp
{{-- LABEL --}} @if ($label) @endif {{-- SELECT / TAG CONTAINER --}}
{{-- TAGS --}} {{-- PLACEHOLDER --}} {{ $placeholder }}
{{-- DROPDOWN --}}
{{-- SEARCH --}}
{{-- LISTA --}}
Sin resultados
{{-- INPUTS REALES --}} @error($name)

{{ $message }}

@enderror