add more controller

This commit is contained in:
root
2026-03-10 00:48:32 -04:00
parent 5eeaec0257
commit 20ee70d153
151 changed files with 9481 additions and 8407 deletions
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Resources\Teachers;
use Illuminate\Http\Resources\Json\JsonResource;
class TeacherAbsenceResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this['id'] ?? 0),
'user_id' => (int) ($this['user_id'] ?? 0),
'date' => (string) ($this['date'] ?? ''),
'semester' => $this['semester'] ?? null,
'school_year' => $this['school_year'] ?? null,
'status' => $this['status'] ?? null,
'reason' => $this['reason'] ?? null,
];
}
}
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources\Teachers;
use Illuminate\Http\Resources\Json\JsonResource;
class TeacherAssignmentResource extends JsonResource
{
public function toArray($request): array
{
return [
'teacher_id' => (int) ($this['teacher_id'] ?? 0),
'firstname' => (string) ($this['firstname'] ?? ''),
'lastname' => (string) ($this['lastname'] ?? ''),
'name' => (string) ($this['name'] ?? ''),
'email' => $this['email'] ?? null,
'cellphone' => $this['cellphone'] ?? null,
'role' => $this['role'] ?? null,
'school_year' => $this['school_year'] ?? null,
'main_assignments' => $this['main_assignments'] ?? [],
'ta_assignments' => $this['ta_assignments'] ?? [],
];
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Resources\Teachers;
use Illuminate\Http\Resources\Json\JsonResource;
class TeacherClassResource extends JsonResource
{
public function toArray($request): array
{
return [
'class_section_id' => (int) ($this['class_section_id'] ?? 0),
'class_section_name' => (string) ($this['class_section_name'] ?? ''),
'class_id' => $this['class_id'] ?? null,
'class_name' => $this['class_name'] ?? null,
'teacher_role' => $this['teacher_role'] ?? null,
'school_year' => $this['school_year'] ?? null,
'semester' => $this['semester'] ?? null,
];
}
}
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Resources\Teachers;
use Illuminate\Http\Resources\Json\JsonResource;
class TeacherStudentResource extends JsonResource
{
public function toArray($request): array
{
return [
'student_id' => (int) ($this['student_id'] ?? 0),
'firstname' => (string) ($this['firstname'] ?? ''),
'lastname' => (string) ($this['lastname'] ?? ''),
'school_id' => $this['school_id'] ?? null,
'is_new' => $this['is_new'] ?? null,
'photo_consent' => $this['photo_consent'] ?? null,
'age' => $this['age'] ?? null,
'school_year' => $this['school_year'] ?? null,
'class_section_id' => $this['class_section_id'] ?? null,
'medical_conditions' => $this['medical_conditions'] ?? [],
'allergies' => $this['allergies'] ?? [],
'medical_conditions_text' => $this['medical_conditions_text'] ?? '',
'allergies_text' => $this['allergies_text'] ?? '',
];
}
}