a guest Nov 9th, 2019 80 Never
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];
RAW Paste Data