Files
alrahma_sunday_school_api/app/Http/Resources/Subjects/SubjectCurriculumResource.php
T
2026-03-10 00:48:32 -04:00

22 lines
646 B
PHP

<?php
namespace App\Http\Resources\Subjects;
use Illuminate\Http\Resources\Json\JsonResource;
class SubjectCurriculumResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this['id'] ?? 0),
'class_id' => (int) ($this['class_id'] ?? 0),
'class_name' => $this['class_name'] ?? null,
'subject' => (string) ($this['subject'] ?? ''),
'unit_number' => $this['unit_number'] ?? null,
'unit_title' => $this['unit_title'] ?? null,
'chapter_name' => (string) ($this['chapter_name'] ?? ''),
];
}
}