add class progress and fix endpoints

This commit is contained in:
root
2026-03-12 17:27:49 -04:00
parent 0f39dbee62
commit 33be0c9a0d
40 changed files with 2086 additions and 438 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Resources\ClassProgress;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class ClassProgressShowResource extends JsonResource
{
public function toArray(Request $request): array
{
$weekly = $this['weekly_reports'] ?? [];
return [
'report' => new ClassProgressReportResource($this['report']),
'weekly_reports' => ClassProgressReportResource::collection(collect($weekly)),
'status_options' => $this['status_options'] ?? [],
];
}
}