Filter Orders
Find Your Orders
Click on categories to filter your order history
@php
// Initialize game stats first
$gameStats = [];
foreach ($orders as $order) {
$items = json_decode($order->cart_data, true);
if (is_array($items)) {
foreach ($items as $item) {
$product = \App\Models\Product::find($item['id'] ?? null);
if ($product && $product->game) {
$gameStats[$product->game] = ($gameStats[$product->game] ?? 0) + 1;
}
}
}
}
$totalCategories = count($gameStats) + 1; // +1 for "All Orders"
@endphp
All Categories
{{ $totalCategories }}
Categories
Browse
Recently
(All Orders)
Pending
({{ $orders->where('status', 'pending')->count() }})
Completed
({{ $orders->where('status', 'completed')->count() }})
Cancelled
({{ $orders->where('status', 'cancelled')->count() }})