PHP code example of livetennisapi / livetennisapi-laravel

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

    

livetennisapi / livetennisapi-laravel example snippets


use LiveTennisApi\Laravel\Facades\LiveTennis;

$live = LiveTennis::listMatches('live');
$player = LiveTennis::getPlayer(1218);
$fixtures = LiveTennis::listFixtures(tour: 'atp');

// Cross-era head-to-head: results archive + our own completed matches. BASIC.
$h2h = LiveTennis::getHeadToHead('federer', 'nadal');

// Point-in-time rankings. Listing mode (PRO); per-player as-of mode (ULTRA).
$table = LiveTennis::listRankings(systems: 'atp', limit: 100);

// The point-by-point tape for one match — works on a LIVE match too. BASIC.
$tape = LiveTennis::getHistoryMatch(18953, sequence: 'clean');

public function __construct(private \LiveTennisApi\LiveTennisApi $tennis) {}
bash
php artisan vendor:publish --tag=livetennis-views