add school calendar logic

This commit is contained in:
root
2026-03-10 16:55:50 -04:00
parent 311bb93977
commit abebe0d9c0
25 changed files with 1358 additions and 750 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Resources\Settings;
use Illuminate\Http\Resources\Json\JsonResource;
class SchoolCalendarEventDetailResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this->id ?? 0),
'title' => (string) ($this->title ?? ''),
'description' => (string) ($this->description ?? ''),
'event_type' => $this->event_type ?? null,
'date' => (string) ($this->date ?? ''),
'notify_parent' => (int) ($this->notify_parent ?? 0),
'notify_teacher' => (int) ($this->notify_teacher ?? 0),
'notify_admin' => (int) ($this->notify_admin ?? 0),
'no_school' => (int) ($this->no_school ?? 0),
'semester' => (string) ($this->semester ?? ''),
'school_year' => (string) ($this->school_year ?? ''),
'created_at' => $this->created_at ?? null,
'updated_at' => $this->updated_at ?? null,
];
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Resources\Settings;
use Illuminate\Http\Resources\Json\JsonResource;
class SchoolCalendarEventResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => $this['id'] ?? null,
'title' => (string) ($this['title'] ?? ''),
'start' => (string) ($this['start'] ?? ''),
'description' => (string) ($this['description'] ?? ''),
'extendedProps' => (array) ($this['extendedProps'] ?? []),
];
}
}