Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 2 | Features | 1 |
1 | <?php |
||
25 | public function toArray(Request $request): array |
||
26 | { |
||
27 | /** @var LengthAwarePaginator<int, ListPostResource> $paginator */ |
||
28 | $paginator = $this->resource; |
||
29 | |||
30 | return [ |
||
31 | 'data' => $this->collection, |
||
32 | 'meta' => [ |
||
33 | 'current_page' => $paginator->currentPage(), |
||
34 | 'from' => $paginator->firstItem(), |
||
35 | 'last_page' => $paginator->lastPage(), |
||
36 | // 'path' => $paginator->path(), |
||
37 | 'per_page' => $paginator->perPage(), |
||
38 | 'to' => $paginator->lastItem(), |
||
39 | 'total' => $paginator->total(), |
||
40 | ], |
||
44 |