Files
alrahma_sunday_school_api/app/Http/Resources/Attendance/TeacherAttendanceFormResource.php
T
2026-03-08 16:33:24 -04:00

27 lines
1002 B
PHP

<?php
namespace App\Http\Resources\Attendance;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class TeacherAttendanceFormResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'teacher_name' => $this['teacher_name'] ?? null,
'students' => $this['students'] ?? [],
'teachers' => $this['teachers'] ?? [],
'class_section_id' => $this['class_section_id'] ?? null,
'sunday_dates' => $this['sunday_dates'] ?? [],
'current_sunday' => $this['current_sunday'] ?? null,
'enable_attendance' => $this['enable_attendance'] ?? null,
'can_edit' => (bool)($this['can_edit'] ?? false),
'class_id' => $this['class_id'] ?? null,
'no_school_days' => $this['no_school_days'] ?? [],
'today' => $this['today'] ?? null,
'locked_by_student' => $this['locked_by_student'] ?? [],
];
}
}