update controllers logic

This commit is contained in:
root
2026-04-23 00:04:35 -04:00
parent 1977a513df
commit ca4ba272fc
353 changed files with 13402 additions and 1301 deletions
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Api\System;
use App\Http\Controllers\Api\Core\BaseApiController;
use App\Models\Stats;
use Symfony\Component\HttpFoundation\Response;
class StatsController extends BaseApiController
{
protected Stats $stats;
public function __construct()
{
parent::__construct();
$this->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);
}
}
}