Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

custom pagination in laravel

 'data' => [
    'meta' => [
    'totalPages' => ceil($pagination->totalRecords / $pagination->perPage),
    'currentPage' => $pagination->currentPage + 1,
    'totalRecords' => $pagination->totalRecords,
    'recordsOnCurrentPage' => count($records),
    'recordFrom' => ($pagination->currentPage * $pagination->perPage) + 1,
    'recordTo' => ($pagination->currentPage * $pagination->perPage) + count($records),
  ],
    'records' => $records,
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #custom #pagination #laravel
ADD COMMENT
Topic
Name
8+7 =