36 lines
1.7 KiB
PHP
36 lines
1.7 KiB
PHP
<div class="mb-3">
|
|
<label for="{{ $name }}" class="form-label">{{ $label }}</label>
|
|
|
|
@if($multipleFileUpload)
|
|
<!-- Multiple File Upload -->
|
|
<div class="border rounded p-3 text-center" wire:loading.class="opacity-50">
|
|
<input type="file" wire:model="image" class="form-control" id="{{ $name }}" accept="image/jpeg,image/png,image/gif" multiple {{ $required ? 'required' : '' }}>
|
|
<i class="bi bi-upload"></i>
|
|
<p class="mt-2">Click or drag file to this area to upload</p>
|
|
<p class="small text-muted">Support for single or bulk upload.</p>
|
|
</div>
|
|
@if($fileList)
|
|
<div class="mt-2 d-flex flex-wrap">
|
|
@foreach($fileList as $url)
|
|
<img src="{{ $url }}" alt="Preview" class="img-thumbnail me-2 mb-2" style="width: 100px; height: 100px;">
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
@else
|
|
<!-- Single File Upload -->
|
|
<div class="border rounded p-3 text-center" wire:loading.class="opacity-50">
|
|
<input type="file" wire:model="image" class="form-control" id="{{ $name }}" accept="image/jpeg,image/png,image/gif" {{ $required ? 'required' : '' }}>
|
|
@if($imageUrl)
|
|
<img src="{{ $imageUrl }}" alt="Preview" class="mt-2" style="width: {{ $imgStyle['width'] }}; height: {{ $imgStyle['height'] }};">
|
|
@else
|
|
<i class="bi bi-upload"></i>
|
|
<p class="mt-2">Click or drag file to this area to upload</p>
|
|
<p class="small text-muted">Support for a single upload only.</p>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
@error('image')
|
|
<div class="text-danger small mt-1">{{ $message }}</div>
|
|
@enderror
|
|
</div> |