@props([ 'name', 'label' => null, 'options' => [], // ['value' => 'label'] or [['value','label','icon'?,'description'?,'group'?,'disabled'?]] 'selected' => null, 'multiple' => false, 'searchable' => true, 'clearable' => false, 'url' => null, // remote/async search: fetch options from this endpoint instead of $options 'help' => null, 'error' => null, // See forms/input.blade.php's comment — same _field.blade.php superset guard. 'value' => null, 'required' => false, 'type' => null, 'checked' => false, 'existingUrl' => null, 'aspectRatio' => null, ]) @php $resolvedError = $error ?? $errors->first($name); $normalizedOptions = collect($options)->map(function ($opt, $key) { $defaults = ['value' => $key, 'group' => null, 'icon' => null, 'description' => null, 'disabled' => false]; return is_array($opt) ? array_merge($defaults, $opt) : array_merge($defaults, ['label' => $opt]); })->values(); @endphp
@if ($multiple) @else @endif
@if ($searchable)
@endif

Loading...

No options found