add projet
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class AdminNotificationAlertsResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'admins' => $this['admins'] ?? [],
|
||||
'subjects' => $this['subjects'] ?? [],
|
||||
'assigned_subjects' => $this['assigned_subjects'] ?? [],
|
||||
'table_ready' => (bool) ($this['table_ready'] ?? false),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PrintRecipientsResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'admins' => $this['admins'] ?? [],
|
||||
'assigned' => $this['assigned'] ?? [],
|
||||
'table_ready' => (bool) ($this['table_ready'] ?? false),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Admin\Progress;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ProgressGroupResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$reports = $this['reports'] ?? [];
|
||||
|
||||
return [
|
||||
'week_start' => $this['week_start'] ?? null,
|
||||
'week_end' => $this['week_end'] ?? null,
|
||||
'class_section_id' => $this['class_section_id'] ?? null,
|
||||
'class_section_name' => $this['class_section_name'] ?? '',
|
||||
'reports' => $reports, // keyed by subject for compatibility
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Admin\Progress;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ProgressReportDetailResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'report' => $this['report'] ?? null,
|
||||
'weekly_reports' => $this['weekly_reports'] ?? [],
|
||||
'subject_sections' => $this['subject_sections'] ?? [],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class TeacherSubmissionReportResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'semester' => $this['semester'] ?? '',
|
||||
'school_year' => $this['school_year'] ?? '',
|
||||
'rows' => TeacherSubmissionRowResource::collection(collect($this['rows'] ?? [])),
|
||||
'notification_history' => $this['notification_history'] ?? [],
|
||||
'summary' => [
|
||||
'total_items' => data_get($this->resource, 'summary.total_items', 0),
|
||||
'missing_items' => data_get($this->resource, 'summary.missing_items', 0),
|
||||
'submitted_items' => data_get($this->resource, 'summary.submitted_items', 0),
|
||||
'submission_percentage' => data_get($this->resource, 'summary.submission_percentage', 0),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user