yayasanvitka/covid19-module

1.0.3 2020-03-20 15:45 UTC

This package is auto-updated.

Last update: 2024-11-21 02:49:30 UTC


README

Latest Stable Version Total Downloads License

Introduction

yayasanvitka/covid19-module is a Laravel package 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 module is created as laravel-modules, and require the following:

Installation & Setup

composer require yayasanvitka/covid19-module

Web Route

  • /api/covid19: Global Data
  • /api/covid19/countries: List of countries
  • /api/covid19/countries/{COUNTRY}: Data per Country

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

Facade Methods

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.