@props([ 'label' => null, 'icon' => null, 'prepend' => null, 'append' => null, 'rows' => 3, 'size' => null, 'help' => null, 'model' => null, 'debounce' => false, 'lazy' => false, 'characterLimit' => -1, ]) @php if ($debounce) $bind = 'debounce.' . (ctype_digit($debounce) ? $debounce : 150) . 'ms'; else if ($lazy) $bind = 'lazy'; else $bind = 'defer'; $wireModel = $attributes->whereStartsWith('wire:model')->first(); $key = $attributes->get('name', $model ?? $wireModel); $id = $attributes->get('id', $model ?? $wireModel); $attributes = $attributes->class([ 'form-control', 'form-control-' . $size => $size, 'rounded-end' => !$append, 'is-invalid' => $errors->has($key), ])->merge([ 'id' => $id, 'rows' => $rows, 'wire:model.' . $bind => $model ?? null, ]); $hasCharacterLimit = $characterLimit > 0 && $model; @endphp
@if($hasCharacterLimit)
caractères restants.
@endif