yayasanvitka/covid19

API for Global Covid 19 Pandemic based on Lumen Framework

1.1.0.2 2020-03-23 13:24 UTC

This package is auto-updated.

Last update: 2024-04-23 22:37:48 UTC


README

Latest Stable Version Total Downloads License

Introduction

yayasanvitka/covid19 is a Lumen based application which was created to easily publish and consume the API for live information about Novel Coronavirus-19. This module is based on API from javieraviles/covidAPI.

Documentation

Requirement

This application is created with Lumen Framework, and required the same package as Lumen 7.

Installation & Setup

composer create-project --prefer-dist yayasanvitka/covid19

If you want to set config, for example disable Batam City, Indonesia data loading, you can set COVID_LOAD_CITY_BATAM on your .env to false.

Web Route

  • /api/global: Global Data
  • /api/global/{DATE}: Global Data by date
  • /api/countries: List of countries
  • /api/countries/{COUNTRY}: Data per Country
  • /api/countries/{COUNTRY}/{DATE}: Data per Country by date
  • /api/city/batam: Data for Batam, Indonesia
  • /api/city/batam/{DATE}: Data for Batam, Indonesia by date

Facade Methods

  • Covid::fetch()
    Fetch data from endpoint
  • Covid::get()
    Get The Data. Returns \Illuminate\Support\Collection. Can be chained with country() method.
  • Covid::country()
    Get the country data.
  • Covid::total()->cases
    Get total data (Global) for cases
  • Covid::total()->todayCases
    Get total data (Global) for todayCases
  • Covid::total()->todayDeath
    Get total data (Global) for todayDeath
  • Covid::total()->recovered
    Get total data (Global) for recovered
  • Covid::total()->deaths
    Get total data (Global) for deaths
  • Covid::total()->active
    Get total data (Global) for active
  • Covid::total()->critical
    Get total data (Global) for critical
  • Covid::total()->casesPerOneMillion
    Get total data (Global) for casesPerOneMillion

Artisan Command

php artisan covid19-update
Run this to update the database

License

MIT License 2020, IT Yayasan Vitka. Based on API from javieraviles, the data may not be used for commercial purposes. Feel free to exted the application for your city, and please contact us on adly@yayasanvitka.id if you found any bugs.