@forelse($items as $index => $item) {{-- --}} @empty @endforelse
# @if($sortField === 'sort_order') {{ $sortDirection === 'asc' ? '🔼' : '🔽' }} @endif Image Item Name @if($sortField === 'name') {{ $sortDirection === 'asc' ? '🔼' : '🔽' }} @endif Description Price @if($sortField === 'price') {{ $sortDirection === 'asc' ? '🔼' : '🔽' }} @endif Stock Expiry Date Actions
{{ $item->sort_order }}{{ $items->firstItem() + $index }} @if (!empty($item->image)) @if (Str::startsWith($item->image, ['http://', 'https://'])) Package Image @elseif (file_exists(storage_path('app/public/' . $item->image))) Package 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
No items found.
{{ $items->links() }}