Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1.    private function paginate($limit, $params = [], $page)
  2.     {
  3.         $currentPage = (isset($page) ? intval($page) : 1);
  4.         $pagData = collect($params)->chunk($limit);
  5.         $result = $pagData[$currentPage - 1]->toArray();
  6.         return ['currentPage' => $currentPage, 'totalPage' => $pagData->count(), 'data' => $result];
  7.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement