get('period', 'today'); try { // Get article stats from service $articleStats = $this->dashboardStatsService->getStats($period); // Get system stats $systemStats = $this->dashboardStatsService->getSystemStats(); // Get available periods $availablePeriods = $this->dashboardStatsService->getAvailablePeriods(); return $this->sendResponse([ 'article_stats' => $articleStats, 'system_stats' => $systemStats, 'available_periods' => $availablePeriods, 'current_period' => $period, ]); } catch (\Exception $e) { throw $e; return $this->sendError('Failed to fetch dashboard stats: ' . $e->getMessage(), [], 500); } } }