fix: add hashid to brand eager load and defensive fallback

- Add hashid to brand eager loading in ProductController
- Add defensive fallback in Brand::getLogoUrl() and getBannerUrl()
- Falls back to direct Storage URL if hashid is missing
- Prevents route generation errors from incomplete eager loading
This commit is contained in:
kelly
2025-12-08 17:10:29 -07:00
parent fca89475cc
commit a55ea906ac

View File

@@ -1511,7 +1511,7 @@ function batchManager(config) {
{{-- D. Audit / Subtle Stats (bottom metadata) --}}
@if($product->exists)
<div class="mt-6 text-sm text-base-content/60 space-y-1">
<p><span class="font-medium">Created:</span> {{ $product->created_at->format('M d, Y g:i A') }} <span class="font-medium">Updated:</span> {{ $product->updated_at->format('M d, Y g:i A') }}</p>
<p><span class="font-medium">Created:</span> {{ $product->created_at?->format('M d, Y g:i A') ?? 'N/A' }} <span class="font-medium">Updated:</span> {{ $product->updated_at?->format('M d, Y g:i A') ?? 'N/A' }}</p>
<p>Cost: ${{ number_format($product->effective_cost_price, 2) }} Wholesale: ${{ number_format($product->wholesale_price ?? 0, 2) }} MSRP: ${{ number_format($product->msrp ?? 0, 2) }} Margin: {{ number_format($product->calculateMargin(), 1) }}%</p>
</div>
@endif