$params */ public function index(array $params = []): Response { $guard = $this->guard('stats.read'); if ($guard instanceof Response) { return $guard; } return $this->adminView('admin/stats/index', [ 'title' => 'Statistiques - Wakdo Admin', 'activeNav' => 'stats', 'counts' => $this->statsRepository()->counts(), 'stock' => $this->statsRepository()->stockHealth(), 'sales' => $this->orderQuery()->salesKpis(), ], $guard); } protected function statsRepository(): StatsRepository { return new StatsRepository($this->db()); } protected function orderQuery(): OrderQueryRepository { return new OrderQueryRepository($this->db()); } }