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

15 lines
No EOL
577 B
PHP

@props([
'labelClass' => '',
'label' => 'Image:',
'accept' => 'image',
'inputClass' => '',
'formClass' => '',
])
<label for="{{ $attributes['id'] ?? $attributes['name'] }}" class="form__label {{ $labelClass }}">
{{ $label }}
</label>
<input type="file" id="{{ $attributes['id'] ?? $attributes['name'] }}" {{ $attributes }}
value="{{ old($attributes['name']) }}" accept="{{ $accept }}/*"
class="form__input--file {{ $inputClass }}">
@error($attributes['name']) <p class="form__error {{ $formClass }}">{{ $message }}</p> @enderror