PHP code example of robertogallea / eloquent-api
1. Go to this page and download the library: Download robertogallea/eloquent-api 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 / eloquent-api example snippets
use robertogallea\EloquentApi\ApiModel;
class YourApiModel extends ApiModel
{
protected $endpoint = 'https://ghibliapi.herokuapp.com/films'; // The endpoint
protected $nextPageField = null;
protected $dataField = null;
}
protected $dataField = 'data';
protected $nextPageField = 'next_page_url';
shell script
php artisan make:api-model