<?php

namespace App\Http\Resources\Grading;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class HomeworkTrackingTeacherResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'class_section_id' => (int) ($this->resource['class_section_id'] ?? 0),
            'class_id' => $this->resource['class_id'] ?? null,
            'class_section_name' => $this->resource['class_section_name'] ?? null,
            'teachers' => $this->resource['teachers'] ?? [],
            'tas' => $this->resource['tas'] ?? [],
        ];
    }
}
