User::count(), 'totalProducts' => ProductVariation::count(), 'totalOrders' => Order::count(), 'recentOrders' => Order::with('user') ->orderBy('created_at', 'desc') ->limit(5) ->get(), 'popularProducts' => OrderItem::popular(10)->get(), 'monthlyRevenue' => Order::getMonthlyRevenue(), ]; return view('admin.dashboard', $data); } }