@props([ 'name', 'type' => 'text', 'value' => null, 'label' => '', 'class' => '', 'is_readonly' => false, 'star' => false, 'list' => false, 'placeholder' => null, 'model' => null, 'id' => null, 'listname' => null, 'html_entities' => false, ]) @php $dotted_name = dotted_string($name); $invalidClass = $errors->has($dotted_name) ? 'is-invalid' : ''; $splitAttributes = implode(' ', explode(' ', $attributes)); $class = "{$invalidClass} form-control {$class}"; $defaultPlaceHolder = __('Enter') . ' ' . $label; $placeholder = $placeholder ?? ($is_readonly === true ? '' : $defaultPlaceHolder); $splitAttributes .= $is_readonly === false ? '' : 'readonly'; $rawValue = $value ?? (isset($model) ? old($name, $model->{$name}) : old($name)); $value = $html_entities ? htmlspecialchars_decode($rawValue, ENT_QUOTES) : $rawValue; $value = preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', $value); $id = $id ?? $name; $listName = $listname ?? $name; @endphp