annotate resources/views/components/form/select.blade.php @ 1:56d9c64d64aa

Setting up the base, still have plenty of work to be done here.
author luka
date Mon, 09 Jun 2025 23:07:17 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
1 @props(['name', 'label', 'options' => [], 'value' => '', 'required' => false])
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
2 <div class="mb-4">
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
3 <label for="{{ $name }}" class="block text-gray-700">{{ $label }}</label>
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
4 <select name="{{ $name }}" id="{{ $name }}" @if ($required) required @endif
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
5 class="mt-1 block w-full rounded border-gray-300 shadow-sm focus:ring focus:ring-blue-200">
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
6 <option value="">Select...</option>
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
7 @foreach ($options as $optionValue => $optionLabel)
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
8 <option value="{{ $optionValue }}" {{ old($name, $value) == $optionValue ? 'selected' : '' }}>
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
9 {{ $optionLabel }}
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
10 </option>
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
11 @endforeach
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
12 </select>
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
13 @error($name)
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
14 <span class="text-red-600 text-sm">{{ $message }}</span>
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
15 @enderror
56d9c64d64aa Setting up the base, still have plenty of work to be done here.
luka
parents:
diff changeset
16 </div>