add more controller
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Students;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class StudentAssignmentResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'student_id' => (int) ($this['student_id'] ?? 0),
|
||||
'name' => (string) ($this['name'] ?? ''),
|
||||
'age' => $this['age'] ?? null,
|
||||
'email' => $this['email'] ?? null,
|
||||
'phone' => $this['phone'] ?? null,
|
||||
'registration_grade' => $this['registration_grade'] ?? null,
|
||||
'class_section_name' => $this['class_section_name'] ?? null,
|
||||
'class_section_names' => $this['class_section_names'] ?? [],
|
||||
'class_section_ids' => $this['class_section_ids'] ?? [],
|
||||
'new_student' => $this['new_student'] ?? null,
|
||||
'registration_date' => $this['registration_date'] ?? null,
|
||||
'school_year' => $this['school_year'] ?? null,
|
||||
'semester' => $this['semester'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Students;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class StudentClassSectionResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => (int) ($this['id'] ?? 0),
|
||||
'class_section_id' => (int) ($this['class_section_id'] ?? 0),
|
||||
'class_section_name' => (string) ($this['class_section_name'] ?? ''),
|
||||
'school_year' => $this['school_year'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Students;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class StudentRemovedResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => (int) ($this['id'] ?? 0),
|
||||
'school_id' => $this['school_id'] ?? null,
|
||||
'firstname' => $this['firstname'] ?? null,
|
||||
'lastname' => $this['lastname'] ?? null,
|
||||
'gender' => $this['gender'] ?? null,
|
||||
'age' => $this['age'] ?? null,
|
||||
'class_sections' => $this['class_sections'] ?? [],
|
||||
'class_section_name' => $this['class_section_name'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Students;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class StudentScoreCardRowResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'school_year' => $this['school_year'] ?? null,
|
||||
'semester' => $this['semester'] ?? null,
|
||||
'homework_avg' => $this['homework_avg'] ?? null,
|
||||
'project_avg' => $this['project_avg'] ?? null,
|
||||
'participation_score' => $this['participation_score'] ?? null,
|
||||
'quiz_avg' => $this['quiz_avg'] ?? null,
|
||||
'test_avg' => $this['test_avg'] ?? null,
|
||||
'attendance_score' => $this['attendance_score'] ?? null,
|
||||
'ptap_score' => $this['ptap_score'] ?? null,
|
||||
'midterm_exam_score' => $this['midterm_exam_score'] ?? null,
|
||||
'semester_score' => $this['semester_score'] ?? null,
|
||||
'class_section_name' => $this['class_section_name'] ?? null,
|
||||
'comments' => $this['comments'] ?? [],
|
||||
'year_score' => $this['year_score'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user