@props([
'label' => '',
'name' => '',
'feedback' => null,
'disabled' => false,
])
@php
$name = $attributes->has('wire:model') ? $attributes->get('wire:model') : $name;
@endphp
has('x-show')) x-show="{{ $attributes->get('x-show') }}" x-cloak @endif>
@isset($label)
@endisset
merge([
'class' => 'form-control'.($errors->has($name) ? ' is-invalid' : ''),
'name' => $name,
'disabled' => $disabled,
'id' => $attributes->has('id') ? $attributes->get('id') : $name,
'placeholder' => $attributes->has('placeholder') ? $attributes->get('placeholder') : $label,
'x-bind:class' => $feedback ? "{'is-invalid': feedback?.$name}" : false,
])
}} />
@if ($feedback)
@elseif ($errors->has($name))
{{ $errors->first($name) }}
@endif