xitox97 / laravel-opendota
Laravel PHP Facade/Wrapper for the OpenDota API
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 1
pkg:composer/xitox97/laravel-opendota
Requires
- php: ^7.2
- guzzlehttp/guzzle: ~6.0
- illuminate/support: ^7.0
Requires (Dev)
- orchestra/testbench: ^5.0
- phpunit/phpunit: ^8.0
README
Unofficial Laravel 7 PHP Facade/Wrapper for the OpenDota API
Support
- Laravel 7+
- OpenDota API (v18.0.0)
All API endpoint supported except explorer and FindMatches
Installation
You can install the package via composer:
composer require xitox97/laravel-opendota
API KEY Set up (Optional)
Publish Laravel Opendota config by run below command, and replace the null value with your api-key.
php artisan vendor:publish --provider Xitox97\LaravelOpendota\LaravelOpendotaServiceProvider --tag="config"
Usage
Every function are return an instance of Illuminate\Http\Client\Response, Therefore you can use variety of method provided by Laravel HTTP Client. Check more function in LaravelOpenDota
Get player info without Parameter
$player = Opendota::getPlayer($player_id); $player->json(); $player->body(); etc...
Get player win lose with Parameter
Refer OpenDota Documentation to know more about exact parameter supported for each endpoint
$playerWinLose = Opendota::getPlayerWL(311360822,['limit' => 1000])->json();
Get match details
$player = Opendota::getMatch($match_id);
Get players ordered by rank/medal tier
$player = Opendota::getPlayersByRank();
Get list of pro players
$player = Opendota::getProPlayers();
Get list of pro matches
$player = Opendota::proMatches();
Get list of randomly sampled public matches
$player = Opendota::publicMatches();
To view more function just open the LaravelOpenDota file. The function name is similar to OpenDota endpoint.
Credits
License
Copyright © 2020 Farhan Hadi (farhan.abdhadi@gmail.com)
The MIT License (MIT). Please see License File for more information.
