ldc-startcoq/resources/views/partials/inputs/bigint-foreign-id.blade.php

17 lines
740 B
PHP

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