Mercurial > packages > framework
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resources/views/components/form/select.blade.php Mon Jun 09 23:07:17 2025 -0400 @@ -0,0 +1,16 @@ +@props(['name', 'label', 'options' => [], 'value' => '', 'required' => false]) +<div class="mb-4"> + <label for="{{ $name }}" class="block text-gray-700">{{ $label }}</label> + <select name="{{ $name }}" id="{{ $name }}" @if ($required) required @endif + class="mt-1 block w-full rounded border-gray-300 shadow-sm focus:ring focus:ring-blue-200"> + <option value="">Select...</option> + @foreach ($options as $optionValue => $optionLabel) + <option value="{{ $optionValue }}" {{ old($name, $value) == $optionValue ? 'selected' : '' }}> + {{ $optionLabel }} + </option> + @endforeach + </select> + @error($name) + <span class="text-red-600 text-sm">{{ $message }}</span> + @enderror +</div>
