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,21 @@
<?php
namespace App\Http\Resources\ClassProgress;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class ClassProgressAttachmentResource extends JsonResource
{
public function toArray(Request $request): array
{
$id = $this['id'] ?? $this->id ?? null;
return [
'id' => $id ? (int) $id : null,
'name' => $this['name'] ?? $this->original_name ?? null,
'file_path' => $this['file_path'] ?? $this->file_path ?? null,
'download_url' => $id ? url("/api/v1/class-progress/attachments/{$id}") : null,
];
}
}