2025-11-11 17:45:58 +03:00

30 lines
760 B
PHP

<?php
namespace App\Http\Resources\Deceased;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\ResourceCollection;
class DeceasedCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'data' => $this->collection,
'meta' => [
'total' => $this->total(),
'per_page' => $this->perPage(),
'current_page' => $this->currentPage(),
'last_page' => $this->lastPage(),
'from' => $this->firstItem(),
'to' => $this->lastItem()
]
];
}
}