15 lines
694 B
PHP
15 lines
694 B
PHP
<div class="mb-3">
|
|
<label for="{{ $name }}" class="form-label">{{ $label }}</label>
|
|
<input type="file" wire:model="image" class="form-control" id="{{ $name }}" accept="image/jpeg,image/png,image/gif" {{ $required ? 'required' : '' }}>
|
|
@if($image)
|
|
<img src="{{ $image->temporaryUrl() }}" alt="Preview" class="mt-2" style="width: {{ $imgStyle['width'] }}; height: {{ $imgStyle['height'] }};">
|
|
@else
|
|
<div class="border rounded p-3 text-center mt-2">
|
|
<i class="bi bi-upload"></i>
|
|
<p>Click or drag file to upload</p>
|
|
</div>
|
|
@endif
|
|
@error('image')
|
|
<div class="text-danger small">{{ $message }}</div>
|
|
@enderror
|
|
</div> |