<?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'] ?? []),
        ];
    }
}
