PHP code example of lucasaba / soccersapi

1. Go to this page and download the library: Download lucasaba/soccersapi 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/ */

    

lucasaba / soccersapi example snippets


$serializer = SerializerBuilder::create()->build();
$client = new Client(HttpClient::create(), $serializer, 'this-is-a-secret-token');

$request = new LeaguesRequest();
$request->withCountry('Italy')
    ->withSeason(2021)
    ->withType(League::LEAGUE_TYPE_CUP);

$response = $client->get($request, LeaguesResponse::class, true);