Laravel 11, Vuexy Admin 10.3, by admin@koneko.mx

This commit is contained in:
2025-01-25 04:23:40 -06:00
parent c3045b43b1
commit 64d505910f
1283 changed files with 140198 additions and 0 deletions

View File

@ -0,0 +1,25 @@
@props([
'options' => [],
'name' => null,
'placeholder' => '',
'selected' => null,
'id' => null
])
@php
$livewireModel = $attributes->get('wire:model', $attributes->get('wire:model.defer'));
$name = $attributes->get('name', $livewireModel);
$id = $attributes->get('id', $name);
$options = is_array($options) ? collect($options) : $options;
@endphp
<select id="{{ $id }}" name="{{ $name }}" {{ $attributes->merge(['class' => 'form-select']) }}>
@if(!empty($placeholder))
<option value="">{{ $placeholder }}</option>
@endif
@foreach($options as $key => $value)
<option value="{{ $key }}" {{ (string) $key === (string) old($name, $selected) ? 'selected' : '' }}>
{{ $value }}
</option>
@endforeach
</select>