-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,11 @@ | |
|
||
Unofficial Laravel 7 PHP Facade/Wrapper for the OpenDota API | ||
|
||
`(This package is still under development)` | ||
## Support | ||
- Laravel 7+ | ||
- OpenDota API (v18.0.0) | ||
> All API endpoint supported except explorer and FindMatches | ||
|
||
## Installation | ||
|
||
|
@@ -15,17 +19,32 @@ 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. | ||
|
||
```bash | ||
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](https://laravel.com/docs/master/http-client) | ||
Every function are return an instance of `Illuminate\Http\Client\Response`, Therefore you can use variety of method provided by [Laravel HTTP Client](https://laravel.com/docs/master/http-client). Check more function in [LaravelOpenDota](https://github.com/xitox97/laravel-opendota/blob/master/src/LaravelOpendota.php) | ||
|
||
### Get player info | ||
### Get player info without Parameter | ||
``` php | ||
$player = Opendota::getPlayer($player_id); | ||
$player->json(); | ||
$player->body(); | ||
etc... | ||
``` | ||
|
||
### Get player win lose with Parameter | ||
> Refer [OpenDota](https://docs.opendota.com) Documentation to know more about exact parameter supported for each endpoint | ||
``` php | ||
$playerWinLose = Opendota::getPlayerWL(311360822,['limit' => 1000])->json(); | ||
``` | ||
|
||
### Get match details | ||
``` php | ||
$player = Opendota::getMatch($match_id); | ||
|
@@ -50,18 +69,15 @@ $player = Opendota::proMatches(); | |
``` php | ||
$player = Opendota::publicMatches(); | ||
``` | ||
|
||
|
||
### Changelog | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. | ||
|
||
> To view more function just open the [LaravelOpenDota](https://github.com/xitox97/laravel-opendota/blob/master/src/LaravelOpendota.php) file. The function name is similar to OpenDota endpoint. | ||
## Credits | ||
|
||
- [Muhammad Farhan Abdul Hadi](https://github.com/xitox97) | ||
- [All Contributors](../../contributors) | ||
|
||
## License | ||
Copyright © 2020 Farhan Hadi ([email protected]) | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. | ||
|
||
|