@props([ 'name', 'label' => null, 'type' => 'text', 'value' => null, 'required' => false, 'help' => null, 'placeholder' => null, // A bootstrap-icons name, rendered inside the control. Optional: every // existing caller omits it and gets exactly the markup it had before. 'icon' => null, // Lets a caller close up the last row in a card without a wrapper div. 'spacing' => 'mb-3', ]) @php $id = $attributes->get('id', 'field-'.$name); $hasError = $errors->has($name); @endphp
@if ($label) @endif
@if ($icon) @endif merge(['class' => 'form-control'.($hasError ? ' is-invalid' : '')]) }} >
@if ($help)
{{ $help }}
@endif {{-- `d-block` because the input now sits inside .clinic-field, so Bootstrap's `.is-invalid ~ .invalid-feedback` sibling rule no longer matches. The block is only rendered when there is an error, so forcing it visible changes nothing else. --}} @error($name)
{{ $message }}
@enderror