24 lines
562 B
PHP
24 lines
562 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\dashboard;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class PaginationResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'current_page' => $this->currentPage(),
|
|
'total_pages' => $this->lastPage(),
|
|
'per_page' => $this->perPage(),
|
|
'total_items' => $this->total(),
|
|
]; }
|
|
}
|