ldc-op-insta/resources/views/bo/partials/inputs/tinyint-enum.blade.php
2023-04-21 14:49:53 +00:00

31 lines
912 B
PHP

@if(!empty($label))
<label for="{{ $id }}" class="col-form-label">
<b>{{ $label }} @if(!empty($required))*@endif</b>
</label>
@endif
<select id="{{ $id }}"
class="form-select"
name="{{ $name }}"
aria-describedby="{{ $id }}Help"
@if(empty($notSized))
size="{{ count($enumClass::toArray()) }}"
@endif
@if(!empty($required))
required
@endif>
@if(!empty($placeholder))
<option value="" @if(is_null(old($name, $shopModel->{$name}->value ?? null))) selected @endif disabled>
{{ $placeholder }}
</option>
@endif
@foreach ($enumValues as $enum)
<option value="{{ $enum->value }}" @if (old($name, $model->{$name}->value ?? null) == $enum->value) selected @endif>
{{ $enum->label }}
</option>
@endforeach
</select>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => "{$id}Help",
'helper' => $helper,
])