@props([ 'name' => null, 'label', 'type' => 'text', 'value' => null, 'prefix' => null, 'disabled' => false, 'required' => false, 'isSelect' => false, 'options' => [], 'placeholder' => 'Select an option', ]) @php $hasName = filled($name); $fieldId = $attributes->get('id', $hasName ? $name : 'field-'.uniqid()); $inputValue = $hasName ? old($name, $value) : $value; $hasError = $hasName && $errors->has($name); $inputClasses = 'vpm-field-box__input' .($isSelect ? ' vpm-field-box__input--select' : '') .(filled($prefix) ? ' vpm-field-box__input--prefix' : '') .($hasError ? ' vpm-field-box__input--error' : ''); @endphp
@if ($isSelect) @elseif (filled($prefix))
{{ $prefix }} except(['class', 'id']) }} >
@else except(['class', 'id']) }} > @endif @if ($hasName) @error($name) {{ $message }} @enderror @endif