ldc-nature-and-respect/resources/views/bo/partials/inputs/select-enum.blade.php
2023-03-24 15:39:11 +00:00

15 lines
737 B
PHP

@if(!empty($label))
<label for="{{ $name }}" class="col-form-label"><b>{{ $label }}@if(!empty($require)) * @endif</b></label>
@endif
<select id="{{ $name }}" class="form-select" 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 ?? (isset($model->data)) ? intval($model->data->{$k}->value) : '' ?? 1) == $associatedModel['value']) selected @endif>
{{ $associatedModel['label'] }}
</option>
@endforeach
</select>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => "{{ $id }}Help",
'helper' => $helper
])