@props([ 'type' => 'text', 'clearValue' => true, 'name', 'autocomplete' => 'off', 'placeholder' => '', 'icon' => null, 'value' => '', 'focus' => '', 'autofocus' => false, 'errorsBag' => null, 'showErrorSpace' => true, 'maxLength' => null, 'disabled' => false, ]) @php $inputId = $attributes->get('id') ?? $name; $bag = $errorsBag ?? $errors ?? session('errors'); $hasError = $bag && $bag->has($name); @endphp
{{-- INPUT GROUP --}}
@if($icon) @endif {{-- FILE TYPE --}} @if($type === 'file') @else {{-- NORMAL INPUT --}} merge([ 'class' => 'form-control ' . $focus ]) }} /> {{-- PASSWORD TOGGLE --}} @if($type === 'password') {{-- CLEAR BUTTON --}} @elseif($clearValue) @endif @endif
{{-- FLUENT ERROR MESSAGE --}} @if($showErrorSpace)
@if($hasError) @foreach($bag->get($name) as $message)
{{ $message }}
@endforeach @endif
@endif