ldc-crm/resources/views/bo/partials/inputs/select-enum.blade.php

21 lines
751 B
PHP
Raw Permalink Normal View History

2023-10-06 15:00:42 +02:00
@if (!empty($label))
<label class="col-form-label" for="{{ $name }}">
<b>{{ $label }}@if (!empty($required))
*
@endif
</b></label>
@endif
<select class="form-select" id="{{ $name }}" name="{{ $name }}" aria-describedby="{{ $id }}Help"
@if (!empty($require)) required @endif>
@foreach ($associatedModels as $associatedModel)
<option value="{{ $associatedModel->value() }}" @if (old($name, $model->{$name}->value ?? ($value ?? 1)) == $associatedModel->value()) selected @endif>
{{ $associatedModel->label() }}
</option>
@endforeach
</select>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => '{{ $id }}Help',
'helper' => $helper,
])