Mercurial > borealpoint
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resources/views/components/form/select.blade.php Sat Aug 23 22:20:51 2025 -0400 @@ -0,0 +1,16 @@ +@props(['name', 'label', 'options' => [], 'value' => '', 'required' => false]) +<div class="mb-3"> + <label for="{{ $name }}" class="form-label">{{ $label }}</label> + <select name="{{ $name }}" id="{{ $name }}" @if ($required) required @endif + class="form-select"> + <option value="">Select...</option> + @foreach ($options as $optionValue => $optionLabel) + <option value="{{ $optionValue }}" {{ old($name, $value) == $optionValue ? 'selected' : '' }}> + {{ $optionLabel }} + </option> + @endforeach + </select> + @error($name) + <div class="text-danger small">{{ $message }}</div> + @enderror +</div>
