blood72 / laravel-riot-api
Riot API wrapper for Laravel
Requires
- php: >=7.3
- dolejska-daniel/riot-api: ^5.0.0
- illuminate/cache: ^7.0|^8.0|^9.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
Suggests
- dolejska-daniel/riot-api: This is the parent project of this unofficial package.
README
This is the parent project's wrapper for Laravel.
It supports initialize LeagueAPI and DataDragonAPI and adjusted to use Laravel cache driver.
Index
Requirement
- PHP >= 7.3
- Laravel ^7.0 | ^8.0 | ^9.0
- dolejska-daniel/riot-api ^5.0.0
Installation
Install using the composer.
composer require blood72/laravel-riot-api
You can publish config file.
php artisan vendor:publish --provider="Blood72\RiotAPI\RiotAPIServiceProvider"
Configuration
It requires RIOT_API_KEY
and RIOT_API_REGION
// in riot-api.php 'key' => env('RIOT_API_KEY'), 'region' => env('RIOT_API_REGION', 'na'),
You can turn ON/OFF Laravel cache driver (default is true
)
'cache' => env('RIOT_API_CACHE', true),
By default, RIOT_API_LEAGUE_LINKING
option is enabled.
It brings static data together while using LeagueAPI and automatically initializes DataDragonAPI.
If you don't to use these default options, you can overwrite or add them through the settings options.
'league' => [ // ... 'settings' => [ // ], ], 'ddragon' => [ // ... 'settings' => [ // ], ],
Usage
You can use Facade or resolve methods
to use LeagueAPI
$summoner = app('league-api')->getSummonerByName('__SOMEONE__'); $matchList = LeagueAPI::getMatchlistByAccount($summoner->accountId);
to use DataDragonAPI
$icon = resolve('ddragon-api')->getChampionIcon('Diana'); $splash = DataDragonAPI::getChampionSplashUrl('Diana', 11);
Other uses can be found on the wiki of the parent project.
Reference
- Daniel Dolejška's RiotAPI PHP7 wrapper
License
This package is open-sourced software licensed under the MIT license.