This is the parent project's wrapper for Laravel.
It supports initialize LeagueAPI and DataDragonAPI and adjusted to use Laravel cache driver.
- PHP >= 7.3
- Laravel ^7.0 | ^8.0 | ^9.0
- dolejska-daniel/riot-api ^5.0.0
Install using the composer.
composer require blood72/laravel-riot-api
You can publish config file.
php artisan vendor:publish --provider="Blood72\RiotAPI\RiotAPIServiceProvider"
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' => [
//
],
],
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.
- Daniel Dolejška's RiotAPI PHP7 wrapper
This package is open-sourced software licensed under the MIT license.