fix: use MinIO paths for default images instead of local paths
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Some checks failed
ci/woodpecker/push/ci Pipeline failed
- Upload dispensary.svg and placeholder-product.svg to MinIO
- Update stores/index.blade.php to use Storage::disk('minio')->url()
- Update stores/show.blade.php to use MinIO for dispensary icon and placeholder
- Update stores/orders.blade.php to use MinIO dispensary icon
- Update Filament ProductsTable to use MinIO placeholder
Fixes missing images on production where local paths don't exist.
This commit is contained in:
@@ -25,7 +25,7 @@ class ProductsTable
|
|||||||
ImageColumn::make('image_path')
|
ImageColumn::make('image_path')
|
||||||
->label('Image')
|
->label('Image')
|
||||||
->circular()
|
->circular()
|
||||||
->defaultImageUrl(url('/images/placeholder-product.png'))
|
->defaultImageUrl(\Storage::disk('minio')->url('defaults/placeholder-product.svg'))
|
||||||
->toggleable(),
|
->toggleable(),
|
||||||
|
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
|
|||||||
10
public/images/defaults/placeholder-product.svg
Normal file
10
public/images/defaults/placeholder-product.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="background:#f3f4f6">
|
||||||
|
<!-- Outer box -->
|
||||||
|
<rect x="15" y="15" width="70" height="70" rx="8" fill="#e5e7eb" stroke="#d1d5db"/>
|
||||||
|
<!-- Inner cannabis leaf silhouette -->
|
||||||
|
<g transform="translate(50, 50)">
|
||||||
|
<path d="M0 15 L0 5" stroke="#9ca3af"/>
|
||||||
|
<path d="M0 5 Q-10 -5 -8 -12 Q0 -8 0 -6 Q0 -8 8 -12 Q10 -5 0 5" fill="#d1d5db" stroke="#9ca3af"/>
|
||||||
|
<path d="M0 0 Q-15 -8 -14 -16 Q-6 -10 0 -6 Q6 -10 14 -16 Q15 -8 0 0" fill="#d1d5db" stroke="#9ca3af"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 635 B |
@@ -154,7 +154,7 @@
|
|||||||
<template x-if="store.business_type === 'dispensary'">
|
<template x-if="store.business_type === 'dispensary'">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<div class="w-10 rounded-lg bg-base-200">
|
<div class="w-10 rounded-lg bg-base-200">
|
||||||
<img src="/images/defaults/dispensary.svg" alt="Dispensary" class="p-1">
|
<img src="{{ Storage::disk('minio')->url('defaults/dispensary.svg') }}" alt="Dispensary" class="p-1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@
|
|||||||
<template x-if="store.business_type === 'dispensary'">
|
<template x-if="store.business_type === 'dispensary'">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<div class="w-10 rounded-lg bg-base-200">
|
<div class="w-10 rounded-lg bg-base-200">
|
||||||
<img src="/images/defaults/dispensary.svg" alt="Dispensary" class="p-1">
|
<img src="{{ Storage::disk('minio')->url('defaults/dispensary.svg') }}" alt="Dispensary" class="p-1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
@if($store->business_type === 'dispensary')
|
@if($store->business_type === 'dispensary')
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<div class="w-10 h-10 rounded-lg bg-base-200">
|
<div class="w-10 h-10 rounded-lg bg-base-200">
|
||||||
<img src="/images/defaults/dispensary.svg" alt="Dispensary" class="p-1">
|
<img src="{{ Storage::disk('minio')->url('defaults/dispensary.svg') }}" alt="Dispensary" class="p-1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<template x-if="s.business_type === 'dispensary'">
|
<template x-if="s.business_type === 'dispensary'">
|
||||||
<div class="avatar flex-shrink-0">
|
<div class="avatar flex-shrink-0">
|
||||||
<div class="w-9 h-9 rounded-lg bg-base-200">
|
<div class="w-9 h-9 rounded-lg bg-base-200">
|
||||||
<img src="/images/defaults/dispensary.svg" alt="Dispensary" class="p-0.5">
|
<img src="{{ Storage::disk('minio')->url('defaults/dispensary.svg') }}" alt="Dispensary" class="p-0.5">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
<div class="flex items-center gap-3">
|
<div class="flex items-center gap-3">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<div class="w-10 h-10 rounded">
|
<div class="w-10 h-10 rounded">
|
||||||
<img :src="product.image_url || '/images/placeholder-product.png'"
|
<img :src="product.image_url || '{{ Storage::disk('minio')->url('defaults/placeholder-product.svg') }}'"
|
||||||
:alt="product.name"
|
:alt="product.name"
|
||||||
class="object-cover">
|
class="object-cover">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user