Unofficial Laravel 7 PHP Facade/Wrapper for the OpenDota API
- Laravel 7+
- OpenDota API (v18.0.0)
All API endpoint supported except explorer and FindMatches
You can install the package via composer:
composer require xitox97/laravel-opendota
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"
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
$player = Opendota::getPlayer($player_id);
$player->json();
$player->body();
etc...
Refer OpenDota Documentation to know more about exact parameter supported for each endpoint
$playerWinLose = Opendota::getPlayerWL(311360822,['limit' => 1000])->json();
$player = Opendota::getMatch($match_id);
$player = Opendota::getPlayersByRank();
$player = Opendota::getProPlayers();
$player = Opendota::proMatches();
$player = Opendota::publicMatches();
To view more function just open the LaravelOpenDota file. The function name is similar to OpenDota endpoint.
Copyright © 2020 Farhan Hadi (farhan.abdhadi@gmail.com)
The MIT License (MIT). Please see License File for more information.