PHP code example of rakibdevs / covid19-laravel-api
1. Go to this page and download the library: Download rakibdevs/covid19-laravel-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/ */
use RakibDevs\Covid19\Covid19;
use RakibDevs\Covid19\Facades\Covid;
// Get current Covid19 by city name
// 1. The traditional way
$wt = new Covid19();
$info = $wt->getCountries('ban');
// 2. The Facade way
$info = Covid::getCountries('ban');
// By country name or portion of string
$info = $wt->getCountries('ban');
// Get all countries
$info = $wt->getAllCountries();
// By country name
$info = $wt->getStatistics();
// Get statistics
$info = $wt->getAllStatistics();
// By country name [tory('bangladesh', '2020-01-01');