@props(['disabled' => false, 'invalid' => false]) @php // A field is marked when it is passed as invalid, or when the backend returned an error for its name. $invalid = $invalid || (isset($errors) && $attributes->has('name') && $errors->has($attributes->get('name'))); $stateClasses = $invalid ? 'border-red-400 focus:border-red-500 focus:ring-red-500' : 'border-gray-300 focus:border-brand-500 focus:ring-brand-500'; @endphp @if ($attributes->get('type') === 'password')
except('class')->merge(['class' => 'block w-full pe-10 rounded-md shadow-sm '.$stateClasses, 'aria-invalid' => $invalid ? 'true' : null]) }}>
@else merge(['class' => 'rounded-md shadow-sm '.$stateClasses, 'aria-invalid' => $invalid ? 'true' : null]) }}> @endif