fanatic/resources/views/components/form/text.blade.php
2022-04-26 12:34:38 -07:00

15 lines
No EOL
566 B
PHP

{{-- expected attributes: name --}}
@props([
'labelClass' => '',
'label',
'current' => null,
'inputClass' => '',
'errorClass' => '',
])
<label for="{{ $attributes['id'] ?? $attributes['name'] }}" class="form__label {{ $labelClass }}">
{{ $label }}
</label>
<input type="text" id="{{ $attributes['id'] ?? $attributes['name'] }}" {{ $attributes }}
value="{{ old($attributes['name'], $current) }}" class="form__input {{ $inputClass }}">
@error($attributes['name']) <p class="form__error {{ $errorClass }}">{{ $message }}</p> @enderror