reconstruction of the project
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class AssignmentOverviewResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'classSections' => AssignmentSectionResource::collection(collect($this->classSections ?? [])),
|
||||
'schoolYears' => $this->schoolYears ?? [],
|
||||
'schoolYear' => $this->schoolYear ?? null,
|
||||
'selectedYear' => $this->selectedYear ?? null,
|
||||
'selectedSemester' => $this->selectedSemester ?? null,
|
||||
'semester' => $this->semester ?? null,
|
||||
'current_school_year' => $this->current_school_year ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class AssignmentSectionResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'class_section_id' => $this['class_section_id'] ?? null,
|
||||
'class_section_name' => $this['class_section_name'] ?? '',
|
||||
'main_teachers' => $this['main_teachers'] ?? [],
|
||||
'teacher_assistants' => $this['teacher_assistants'] ?? [],
|
||||
'students' => $this['students'] ?? [],
|
||||
'semester' => $this['semester'] ?? '',
|
||||
'school_year' => $this['school_year'] ?? '',
|
||||
'description' => $this['description'] ?? '',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user