Mercurial > borealpoint
annotate resources/views/components/form/select.blade.php @ 0:9d7dcd54c677
Initial Commit and package setup
| author | luka |
|---|---|
| date | Sat, 23 Aug 2025 22:20:51 -0400 |
| parents | |
| children |
| rev | line source |
|---|---|
| 0 | 1 @props(['name', 'label', 'options' => [], 'value' => '', 'required' => false]) |
| 2 <div class="mb-3"> | |
| 3 <label for="{{ $name }}" class="form-label">{{ $label }}</label> | |
| 4 <select name="{{ $name }}" id="{{ $name }}" @if ($required) required @endif | |
| 5 class="form-select"> | |
| 6 <option value="">Select...</option> | |
| 7 @foreach ($options as $optionValue => $optionLabel) | |
| 8 <option value="{{ $optionValue }}" {{ old($name, $value) == $optionValue ? 'selected' : '' }}> | |
| 9 {{ $optionLabel }} | |
| 10 </option> | |
| 11 @endforeach | |
| 12 </select> | |
| 13 @error($name) | |
| 14 <div class="text-danger small">{{ $message }}</div> | |
| 15 @enderror | |
| 16 </div> |
