yayasanvitka / covid19
API for Global Covid 19 Pandemic based on Lumen Framework
Requires
- php: ^7.2.5
- guzzlehttp/guzzle: ^6.5
- laravel/lumen-framework: ^7.0
- laravel/tinker: ^2.3
- league/flysystem: ^1.0
- nesbot/carbon: ^2.31
Requires (Dev)
- fzaninotto/faker: ^1.9.1
- mockery/mockery: ^1.3.1
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-10-23 23:50:38 UTC
README
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 endpointCovid::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 casesCovid::total()->todayCases
Get total data (Global) for todayCasesCovid::total()->todayDeath
Get total data (Global) for todayDeathCovid::total()->recovered
Get total data (Global) for recoveredCovid::total()->deaths
Get total data (Global) for deathsCovid::total()->active
Get total data (Global) for activeCovid::total()->critical
Get total data (Global) for criticalCovid::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.