| {{ $item->sort_order }} | {{-- {{ $items->firstItem() + $index }} | --}}
@if (!empty($item->image))
@if (Str::startsWith($item->image, ['http://', 'https://']))
@elseif (file_exists(storage_path('app/public/' . $item->image)))
@else
No Image
@endif
@else
No Image
@endif
|
{{ $item->name }} |
{{ Str::limit($item->description, 50) }} |
{{ number_format($item->price, 2) }} 🌟 |
@php
if ($item->stock == 999) {
$stockLabel = 'Unlimited';
$stockClass = 'badge-primary';
} else {
$stockLabel = $item->stock;
$stockClass = $item->stock > 10 ? 'badge-success'
: ($item->stock > 0 ? 'badge-warning' : 'badge-danger');
}
@endphp
{{ $stockLabel }}
|
{{ $item->expiry_date ? \Carbon\Carbon::parse($item->expiry_date)->format('Y-m-d h:i A') : 'N/A' }} |
Edit
|
@empty