PHP code example of dotman / laravel-covid

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

    

dotman / laravel-covid example snippets



namespace App\Http\Controllers;

use Dotman\Covid\Covid;

/**
 * Gets all the affected countries
 * @return array
 */
Covid::getCountries()

/**
 * Gets cases per country
 * @param string  country Slug from the all countries results
 * @return array
 */
Covid::getCasesPerCountry($slug)

/**
 * Gets total cases per country
 * @param string  country Slug from the all countries results
 * @return array
 */
Covid::getTotalCasesPerCountry($slug)

/**
 * Get cases per country by passing the country slug and status
 * @param string  country Slug and status could either be confirmed, recovered, deaths.
 * @return array
 */
Covid::getCasesPerCountryPerStatus($slug, $status)

/**
 * Get total cases per country by passing the country slug and status
 * @param string  country Slug and status could either be confirmed, recovered, deaths.
 * @return array
 */
Covid::getTotalCasesPerCountryPerStatus($slug, $status)

/**
 * Summary of new and total cases per country
 * @param string  state or state code
 * @return array
 */
Covid::getSummary()