<?php

namespace App\Http\Resources\Preferences;

use Illuminate\Http\Resources\Json\ResourceCollection;

class PreferencesCollection extends ResourceCollection
{
    public $collects = PreferencesListResource::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,
            ],
        ];
    }
}
