2021-06-09 23:20:25 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Support\Resources;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\PaginatedResourceResponse;
|
|
|
|
use Illuminate\Support\Arr;
|
|
|
|
|
|
|
|
class CustomPaginatedResourceResponse extends PaginatedResourceResponse
|
|
|
|
{
|
|
|
|
protected function paginationLinks($paginated)
|
|
|
|
{
|
2021-06-10 23:08:25 +08:00
|
|
|
return [
|
|
|
|
'first' => null,
|
|
|
|
'last' => null,
|
|
|
|
'prev' => null,
|
|
|
|
'next' => null,
|
|
|
|
];
|
2021-06-09 23:20:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function meta($paginated)
|
|
|
|
{
|
2021-06-10 23:08:25 +08:00
|
|
|
return Arr::except($paginated, [
|
2021-06-09 23:20:25 +08:00
|
|
|
'data',
|
|
|
|
'first_page_url',
|
|
|
|
'last_page_url',
|
|
|
|
'prev_page_url',
|
|
|
|
'next_page_url',
|
2021-06-10 23:08:25 +08:00
|
|
|
'links',
|
2021-06-09 23:20:25 +08:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|