<?php

namespace App\Http\Resources\Events;

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

class EventStudentChargeResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id' => (int) ($this['id'] ?? 0),
            'name' => $this['name'] ?? '',
            'charged' => (bool) ($this['charged'] ?? false),
        ];
    }
}
