<?php

namespace App\Http\Resources\Families;

use Illuminate\Http\Resources\Json\JsonResource;

class FamilyStudentResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'id' => (int) ($this['id'] ?? 0),
            'firstname' => (string) ($this['firstname'] ?? ''),
            'lastname' => (string) ($this['lastname'] ?? ''),
            'grade' => (string) ($this['grade'] ?? ''),
        ];
    }
}
