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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
1 @props(['name', 'label', 'options' => [], 'value' => '', 'required' => false])
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
2 <div class="mb-3">
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
3 <label for="{{ $name }}" class="form-label">{{ $label }}</label>
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
4 <select name="{{ $name }}" id="{{ $name }}" @if ($required) required @endif
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
5 class="form-select">
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
6 <option value="">Select...</option>
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
7 @foreach ($options as $optionValue => $optionLabel)
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
8 <option value="{{ $optionValue }}" {{ old($name, $value) == $optionValue ? 'selected' : '' }}>
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
9 {{ $optionLabel }}
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
10 </option>
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
11 @endforeach
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
12 </select>
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
13 @error($name)
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
14 <div class="text-danger small">{{ $message }}</div>
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
15 @enderror
9d7dcd54c677 Initial Commit and package setup
luka
parents:
diff changeset
16 </div>