<?php

namespace App\Http\Resources\Subjects;

use Illuminate\Http\Resources\Json\JsonResource;

class SubjectClassResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'id' => (int) ($this['id'] ?? 0),
            'class_name' => (string) ($this['class_name'] ?? ''),
            'school_year' => $this['school_year'] ?? null,
        ];
    }
}
