ldc-boutique-cnc/resources/views/partials/inputs/tinyint-enum.blade.php
2023-02-06 15:52:49 +01:00

25 lines
898 B
PHP

<label for="{{ $id }}" class="col-form-label"><b>{{ $label }} @if(!empty($required))*@endif</b></label>
<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 ?? $enumClass::toArray() as $enum)
<option value="{{ $enum->value }}" @if (old($name, $model->{$name}->value ?? null) == $enum->value) selected @endif>
{{ $enum->label }}
</option>
@endforeach
</select>
@include('back::modules.input-error', [
'inputName' => $name,
'helperId' => "{$id}Help",
'helper' => $helper,
])