uuid = 'component'.md5(serialize($this)).$id; if (($this->allowAll || $this->compact) && ($this->single || $this->searchable)) { throw new Exception('`allow-all` and `compact` does not work combined with `single` or `searchable`.'); } } public function getOptionValue($option): mixed { $value = data_get($option, $this->optionValue); if ($this->valuesAsString) { return "'$value'"; } if ($this->escapeValues) { $value = addslashes($value); return "'$value'"; } return is_numeric($value) && ! str($value)->startsWith('0') ? $value : "'$value'"; } public function render(): View|Closure|string { return <<<'HTML'
{{-- STANDARD LABEL --}} @if($label && !$inline) {{ $label }} @if($attributes->get('required')) * @endif @endif {{-- ERROR --}} @if(!$omitError) @endif {{-- HINT --}} @if($hint)
{{ $hint }}
@endif
{{-- OPTIONS LIST --}}
{{-- PROGRESS --}} @if(!$noProgress) @endif {{-- SELECT ALL --}} @if($allowAll)
{{ $allowAllText }}
{{ $removeAllText }}
@endif {{-- NO RESULTS --}}
{{ $noResultText }}
@forelse($options as $option)
{{-- ITEM SLOT --}} @if($item) {{ $item($option) }} @else @endif {{-- SELECTION SLOT --}} @if($selection) @endif
@empty
No results found.
@endforelse
HTML; } }