add more controller
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Parents;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ParentAttendanceReportResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => (int) ($this['id'] ?? 0),
|
||||
'parent_id' => (int) ($this['parent_id'] ?? 0),
|
||||
'student_id' => (int) ($this['student_id'] ?? 0),
|
||||
'class_section_id' => $this['class_section_id'] ?? null,
|
||||
'report_date' => (string) ($this['report_date'] ?? ''),
|
||||
'type' => (string) ($this['type'] ?? ''),
|
||||
'arrival_time' => $this['arrival_time'] ?? null,
|
||||
'dismiss_time' => $this['dismiss_time'] ?? null,
|
||||
'reason' => $this['reason'] ?? null,
|
||||
'semester' => $this['semester'] ?? null,
|
||||
'school_year' => $this['school_year'] ?? null,
|
||||
'status' => $this['status'] ?? null,
|
||||
'firstname' => $this['firstname'] ?? null,
|
||||
'lastname' => $this['lastname'] ?? null,
|
||||
'class_section_name' => $this['class_section_name'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Parents;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ParentAttendanceResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'firstname' => (string) ($this['firstname'] ?? ''),
|
||||
'lastname' => (string) ($this['lastname'] ?? ''),
|
||||
'date' => (string) ($this['date'] ?? ''),
|
||||
'status' => (string) ($this['status'] ?? ''),
|
||||
'reason' => $this['reason'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Parents;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ParentEmergencyContactResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => (int) ($this['id'] ?? 0),
|
||||
'name' => (string) ($this['emergency_contact_name'] ?? ''),
|
||||
'cellphone' => (string) ($this['cellphone'] ?? ''),
|
||||
'email' => $this['email'] ?? null,
|
||||
'relation' => $this['relation'] ?? null,
|
||||
'semester' => $this['semester'] ?? null,
|
||||
'school_year' => $this['school_year'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Parents;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ParentStudentResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => (int) ($this['id'] ?? 0),
|
||||
'firstname' => (string) ($this['firstname'] ?? ''),
|
||||
'lastname' => (string) ($this['lastname'] ?? ''),
|
||||
'dob' => $this['dob'] ?? null,
|
||||
'gender' => $this['gender'] ?? null,
|
||||
'registration_grade' => $this['registration_grade'] ?? null,
|
||||
'school_year' => $this['school_year'] ?? null,
|
||||
'semester' => $this['semester'] ?? null,
|
||||
'class_section' => $this['class_section'] ?? null,
|
||||
'enrollment_status' => $this['enrollment_status'] ?? null,
|
||||
'admission_status' => $this['admission_status'] ?? null,
|
||||
'disable_enroll' => (bool) ($this['disable_enroll'] ?? false),
|
||||
'allergies' => $this['allergies'] ?? [],
|
||||
'medical_conditions' => $this['medical_conditions'] ?? [],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user