add projet

This commit is contained in:
root
2026-03-05 12:29:37 -05:00
parent 8d1eef8ba8
commit 23b7db1107
9109 changed files with 1106501 additions and 73 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Controllers\Api;
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);
}
}
}