fanatic/resources/views/components/form/date.blade.php
2022-04-27 19:33:19 -07:00

16 lines
No EOL
597 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="date" id="{{ $attributes['id'] ?? $attributes['name'] }}" {{ $attributes }}
value="{{ old($attributes['name'], $current?->format(FORM_DATE_FMT)) }}"
class="form__input {{ $inputClass }}">
@error($attributes['name']) <p class="form__error {{ $errorClass }}">{{ $message }}</p> @enderror