lasthourcloud/resources/views/components/forms/select.blade.php
Andras Bacsai e5aad4d170 updates
2023-06-05 12:07:55 +02:00

28 lines
644 B
PHP

@props([
'id' => null,
'label' => null,
'required' => false,
])
<span {{ $attributes->merge(['class' => 'flex flex-col']) }}>
<label class="label" for={{ $id }}>
<span class="label-text">
@if ($label)
{{ $label }}
@else
{{ $id }}
@endif
@if ($required)
<span class="text-warning">*</span>
@endif
</span>
</label>
<select {{ $attributes }} wire:model.defer={{ $id }}>
{{ $slot }}
</select>
@error($id)
<div class="text-red-500">{{ $message }}</div>
@enderror
</span>