Commit 69376e11 authored by Thidaporn Laisan's avatar Thidaporn Laisan
Browse files

fix issue upload

parent fa570b82
......@@ -101,16 +101,22 @@
@if ($uploadFilePathName1)
<div class="mt-4 relative inline-block rounded-lg overflow-hidden shadow-lg border border-gray-300">
@if ($uploadFilePathName1 instanceof \Illuminate\Http\UploadedFile)
<img src="{{ $uploadFilePathName1->temporaryUrl() }}" alt="Uploaded Image" class="w-200 h-200 object-cover">
<img src="{{ $uploadFilePathName1->temporaryUrl() }}" alt="Uploaded Image" class="w-64 h-64 object-cover">
@elseif (\Illuminate\Support\Facades\Storage::disk('public')->exists($uploadFilePathName1))
<img src="{{ asset('storage/' . $uploadFilePathName1) }}" alt="Uploaded Image" class="w-64 h-64 object-cover">
@else
<img src="{{ asset('storage/' . $uploadFilePathName1) }}" alt="Uploaded Image" class="w-200 h-200">
<div class="w-64 h-64 bg-gray-100 flex items-center justify-center text-gray-500 italic">
No file uploaded
</div>
@endif
@if ($uploadFilePathName1 instanceof \Illuminate\Http\UploadedFile || \Illuminate\Support\Facades\Storage::disk('public')->exists($uploadFilePathName1))
<button wire:click.prevent="removeFile('uploadFilePathName1')" class="absolute top-2 right-2 bg-red-600 text-white rounded-full p-1 shadow-md hover:bg-red-700 transition duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 9l-5 5-1-1 5-5-5-5 1-1 5 5 5-5 1 1-5 5 5 5-1 1-5-5z" clip-rule="evenodd" />
</svg>
</button>
@endif
</div>
@else
<div class="mt-4 text-sm text-gray-500 italic">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment