| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Controller extends BaseController |
||
| 12 | { |
||
| 13 | use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
||
| 14 | |||
| 15 | 28 | public function paginate($items) |
|
| 16 | { |
||
| 17 | 28 | $perPage = request()->input('per_page', 10); |
|
| 18 | 28 | $page = request()->input('page', 1); |
|
| 19 | |||
| 20 | 28 | $slicedItems = collect($items)->forPage($page, $perPage)->values(); |
|
| 21 | |||
| 22 | 28 | return $this->paginationResponse($slicedItems, count($items)); |
|
| 23 | } |
||
| 24 | |||
| 25 | 36 | public function paginationResponse($items, $count) |
|
| 37 | } |
||
| 38 | } |
||
| 39 |