<?php

namespace App\Http\Resources\Teachers;

use Illuminate\Http\Resources\Json\JsonResource;

class TeacherClassResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'class_section_id' => (int) ($this['class_section_id'] ?? 0),
            'class_section_name' => (string) ($this['class_section_name'] ?? ''),
            'class_id' => $this['class_id'] ?? null,
            'class_name' => $this['class_name'] ?? null,
            'teacher_role' => $this['teacher_role'] ?? null,
            'school_year' => $this['school_year'] ?? null,
            'semester' => $this['semester'] ?? null,
        ];
    }
}
