1. Go to this page and download the library: Download rs/builder-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/ */
use RedSnapper\Builder\BuilderRequestFactory;
public function __construct(BuilderRequestFactory $factory)
{
$this->factory = $factory;
# or...
$factory = app()->make(BuilderRequestFactory::class);
$pendingRequest = $factory->new();
$response = $pendingRequest->get('apiPages');
}
$data = $response->data(); # get json decoded data
if($response->failed()) {
$errorMsg = $response->errorMsg();
}
$response->data();
$response->successful();
$response->failed();
$response->errorMsg(); # error msg provided by Builder
$response->status(); # status code of the response
$response->throw(); # throw an exception if a server or client error occurred
$response->getResponse(); # get the underlying 'Illuminate\Http\Client\Response' object