PHP code example of askedio / laravel-item-paginate

1. Go to this page and download the library: Download askedio/laravel-item-paginate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

askedio / laravel-item-paginate example snippets


use \Askedio\ItemPaginator\ItemPaginatorTrait;

\Askedio\ItemPaginator\ItemPaginatorServiceProvider::class,

$users = new User();

$paginated = $users->itemPaginate();

dd($paginated);

itemPaginate($perPage = null, $columns = ['*'], $pageName = 'from', $from = 0, $field = null)

array:6 [
  "limit" => 2
  "next_page_url" => "http://localhost?from=190"
  "from" => 100
  "to" => 190
  "data" => array:2 [
    0 => array:8 [
      "id" => 100
      "name" => "test"
      "email" => "[email protected]"
      "password" => "test"
      "remember_token" => null
      "created_at" => "2016-08-02 18:13:19"
      "updated_at" => "2016-08-02 18:13:19"
      "deleted_at" => null
    ]
    1 => array:8 [
      "id" => 190
      "name" => "test2"
      "email" => "[email protected]"
      "password" => "test"
      "remember_token" => null
      "created_at" => "2016-08-02 18:13:19"
      "updated_at" => "2016-08-02 18:13:19"
      "deleted_at" => null
    ]
  ]
]