stats = model(Stats::class); } public function index() { try { $stats = $this->stats->findAll(); return $this->success($stats, 'Statistics retrieved successfully'); } catch (\Throwable $e) { log_message('error', 'Stats retrieval error: ' . $e->getMessage()); return $this->respondError('Failed to retrieve statistics', Response::HTTP_INTERNAL_SERVER_ERROR); } } }