PHP code example of slvler / livescore-service
1. Go to this page and download the library: Download slvler/livescore-service 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/ */
slvler / livescore-service example snippets
php artisan vendor:publish --tag=livescore
'livescore' => [
'base_url' => 'v3.football.api-sports.io',
'api_key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
]
use slvler\LiveScoreService\LiveScoreClient;
$client = new LiveScoreClient();
$client->general()->getStatus();
$client->countries()->getAll();
$client->countries()->getAll(['code' => 'FR']);
$client->leagues()->getLeagues(['season' => '2018', 'id' => '33']);
$client->leagues()->getLeaguesSeasons();
$client->team()->getTeamsInformation(['name' => 'manchester united']);
$client->team()->getTeamsStatistics(['league' => '39', 'team' => '33', 'season' => '2019']);
$client->team()->getTeamsSeasons(['team' => '33']);
$client->team()->getTeamCountries();
$client->venues()->getVenues(['name' => 'Old Trafford']);
$client->standings()->getStandings([ 'league' => '39', 'season' => '2019']);
$variable = $client->fixtures()->getRounds(['league' => '39', 'season' => 2019]);
$client->fixtures()->getFixtures(['id' => '215662']);
$client->fixtures()->getHeadToHead(['h2h' => '33-34']);
$client->fixtures()->getStatistics(['fixture' => '215662']);
$client->fixtures()->getEvents(['fixture' => '215662']);
$client->fixtures()->getLineups(['fixture' => '592872']);
$client->fixtures()->getPlayersStatistics(['fixture' => '169080']);
$client->injuries()->getInjuries(['league' => '2', 'season' => '2020']);
$client->predictions()->getPredictions(['fixture' => '198772']);
$client->coachs()->getCoachs(['id' => '1']);
$client->players()->getSeasons(['player' => '276']);
$client->players()->getPlayers(['id' => '19088', 'season' => '2018']);
$client->players()->getSquads(['team' => '33']);
$client->players()->getTopScorers(['season' => '2018', 'league' => '61']);
$client->players()->getTopAssists(['season' => '2020', 'league' => '61']);
$client->players()->getTopYellowCards(['season' => '2020', 'league' => '61']);
$client->players()->getTopRedCards(['season' => '2020', 'league' => '61']);
$client->transfer()->getTransfer(['player' => '35845']);
$client->trophies()->getTrophies(['player' => '35845']);
$client->sidelined()->getSidelined(['player' => '276']);
$client->odds()->getOddsLive();
$client->odds()->getOddsLivBets(['id' => "1"]);
$client->odds()->getOdds(['date' => "2020-05-15"]);
$client->odds()->getOddsMapping();
$client->odds()->getOddsBookmakers();
$client->odds()->getOddsBets();