Skip to content

A laravel package for fetching covid-19 data across the world

License

Notifications You must be signed in to change notification settings

dotmarn/laravel-covid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Laravel-Covid

A laravel package for fetching covid-19 data across the world

Installation

You can install the package using composer

$ composer require dotman/laravel-covid

Usage

You can use it in your controller like so:

<?php
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()

Appreciation

Huge thanks go to the Kyle Redelinghuys crew for providing a fluent and awesome API

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter.

Don't forget to follow me on twitter!

Thanks! Kasim Ridwan.

License

The MIT License (MIT). Please see License File for more information.

About

A laravel package for fetching covid-19 data across the world

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages