PHP code example of pendonl / php-club-dataservice
1. Go to this page and download the library: Download pendonl/php-club-dataservice 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/ */
pendonl / php-club-dataservice example snippets
// app/Providers/AppServiceProvider.php
$this->app->bind(\App\Knvb\ApiInterface::class, function() {
return new \App\Knvb\Api();
});
// Some other class
public function handle(\App\Knvb\ApiInterface $api) {
$club = $api->setApiKey('your_api_key_here')->getClub();
....
}
composer
$teams = $club->getTeams();
foreach($teams as $team) {
// $team->teamnaam;
// Get competitions
$competitions = $team->competitions();
foreach($competitions as $competition) {
// $competition->competitienaam;
// Fixtures
$competition->fixtures();
// Results
$competition->results();
// Table standings
$competition->table();
}
}