PHP code example of sammyt / paginate-collection

1. Go to this page and download the library: Download sammyt/paginate-collection 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/ */

    

sammyt / paginate-collection example snippets


Route::get('/users', function() {
   $userCollection = User::all();

   $paginatedUsersCollection = paginate_collection(
       $userCollection,
       10,
       null
   );
   
   dd($paginatedUsersCollection);
});