1. Go to this page and download the library: Download sethsharp/odds-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/ */
$this->app->bind(OddsClient::class, function () {
return new OddsClient(config('odds-api.api_key'));
});
use HandlesOddsResponse;
public function __invoke(OddsClient $client): Response
{
$response = $client->setRegion('us')
->getOddsForSport(SportsEnum::RUGBYLEAGUE_NRL);
return $this->extractJsonFromResponse($response);
}