{{-- Form field with label and error message. type: text | email | tel | number | textarea | select (pass :options) | radio-group (pass :options) | file (pass accept=".pdf,.doc") --}} @props([ 'name', 'label', 'type' => 'text', 'required' => false, 'options' => [], 'placeholder' => '', 'hint' => null, 'autocomplete' => null, 'value' => null, // default choice for a select, used when there is no old input 'accept' => null, // file types offered by a file field's picker ]) @php $id = 'f-'.$name; $hasError = $errors->has($name); $errorClass = $hasError ? '!border-red-500' : ''; @endphp
{{ $hint }}
@endif @error($name){{ $message }}
@enderror