@props([ 'id' => null, 'name', 'label' => null, 'value' => null, 'placeholder' => null, 'hint' => null, 'error' => null, 'required' => false, 'disabled' => false, 'readonly' => false, 'loading' => false, 'wide' => false, 'rows' => 4, ]) @php $id = $id ?: $name; $viewErrors = isset($errors) && $errors instanceof \Illuminate\Support\ViewErrorBag ? $errors : null; $error = $error ?: ($viewErrors?->has($name) ? $viewErrors->first($name) : null); $describedBy = collect([ filled($hint) ? $id.'_hint' : null, filled($error) ? $id.'_error' : null, $attributes->get('aria-describedby'), ])->filter()->unique()->implode(' '); $controlAttributes = $attributes->except(['aria-describedby', 'aria-invalid', 'aria-busy']); @endphp