<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kielabokkie / laravel-guzzle-api-service example snippets
return [
/*
* Enable logging of request and responses to storage/logs/api-service.log
*/
'logging_enabled' => env('API_SERVICE_LOGGING_ENABLED', false),
/*
* The namespace where your API Service classes are created under.
* This will be appended to your base namespace. So the config below
* will create a class under App\Support\Services.
*/
'namespace' => 'Support\Services'
];
namespace App\Support\Services;
use Kielabokkie\GuzzleApiService\ApiClient;
class HttpBinService extends ApiClient
{
protected $baseUrl = 'https://httpbin.org';
public function __construct()
{
$this->setClient();
}
}
public function yourGetRequest()
{
$response = $this->get('/get'));
return json_decode($response->getBody()->getContents());
}