mhauri / lotto-parser
Get the lotto numbers from the last draw of Swiss Lotto & Euro Millions
1.0.1
2021-02-23 13:00 UTC
Requires
- guzzlehttp/guzzle: ^7.2
- imangazaliev/didom: ^1.16
- nesbot/carbon: ^2.45
Requires (Dev)
- phpunit/phpunit: ^9.5
README
Lotto Parser
PHP library for parsing Swiss Lotto and Euro Millions results from Swisslos.
Installation
composer require mhauri/lotto-parser
Usage
To get the latest results from Swiss Lotto
<?php use LottoParser\Client\SiwssLotto $lotto = new SwissLotto(); $data = $lotto->current()->get(); // to Array $data = $lotto->current()->toArray(); // to JSON $data = $lotto->current()->toJson();
To get the results from a specific date
<?php use Carbon\Carbon; use LottoParser\Client\SiwssLotto $lotto = new SwissLotto(); $date = Carbon::create(2021,02,13); $data = $lotto->byDate($date)->get(); // to Array $data = $lotto->byDate($date)->toArray(); // to JSON $data = $lotto->byDate($date)->toJson();
The same applies for Euro Millions, just replace $lotto = new SwissLotto()
with
$lotto = new EuroMillions();
Support
If you have any issues with this library, open an issue on GitHub.
Contribution
Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.
Developer
Marcel Hauri, and all other contributors