Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function paginate($limit, $params = [], $page)
- {
- $currentPage = (isset($page) ? intval($page) : 1);
- $pagData = collect($params)->chunk($limit);
- $result = $pagData[$currentPage - 1]->toArray();
- return ['currentPage' => $currentPage, 'totalPage' => $pagData->count(), 'data' => $result];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement