PHP code example of robertogallea / laravel-lazy-rest

1. Go to this page and download the library: Download robertogallea/laravel-lazy-rest 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/ */

    

robertogallea / laravel-lazy-rest example snippets


$paginatedEndpoint = 'http://api.with-15-elements-per-page';

$collection = \LazyRest::load($paginatedEndpoint);

// Loads only first page
dump($collection->skip(10)->first());
 
// loads all the pages
dump($collection->last());

'fields' => [
    'next_page_url' => 'next_page_url',
    'data' => 'data',

    'timeout' => 5.0,
];