add controllers, servoices

This commit is contained in:
root
2026-03-09 02:52:13 -04:00
parent c8de5f7edc
commit d76c871cb7
501 changed files with 34439 additions and 21843 deletions
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources\Incidents;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class IncidentAnalysisStudentResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'student_id' => $this->resource['student_id'] ?? null,
'student_name' => $this->resource['student_name'] ?? null,
'grade' => $this->resource['grade'] ?? null,
'total' => (int) ($this->resource['total'] ?? 0),
'open' => (int) ($this->resource['open'] ?? 0),
'closed' => (int) ($this->resource['closed'] ?? 0),
'canceled' => (int) ($this->resource['canceled'] ?? 0),
'last_incident' => $this->resource['last_incident'] ?? null,
'logs' => $this->resource['logs'] ?? [],
];
}
}