<?php

namespace App\Http\Resources\Classes;

use Illuminate\Http\Resources\Json\ResourceCollection;

class ClassSectionCollection extends ResourceCollection
{
    public $collects = ClassSectionResource::class;

    public function toArray($request): array
    {
        return parent::toArray($request);
    }

    public function with($request): array
    {
        return [
            'meta' => [
                'total' => $this->resource->total() ?? null,
                'per_page' => $this->resource->perPage() ?? null,
                'current_page' => $this->resource->currentPage() ?? null,
                'last_page' => $this->resource->lastPage() ?? null,
            ],
        ];
    }
}
