lasthourcloud/resources/views/components/inputs/select.blade.php
Andras Bacsai d4c35dc6c8 wip
2023-05-18 13:49:49 +02:00

26 lines
548 B
PHP

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