<?php

namespace App\Http\Resources;

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

class SiswaResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id'               => $this->id,
            'nisn'             => $this->nisn,
            'nama'             => $this->nama,
            'kelas'            => $this->kelas,
            'jurusan'          => $this->jurusan,
            'status_kelulusan' => $this->status_kelulusan,
            'tahun_ajaran'     => $this->tahun_ajaran,
            'created_at'       => $this->created_at?->toDateString(),
            'updated_at'       => $this->updated_at?->toDateString(),
        ];
    }
}
