blood72/laravel-riot-api

This package is abandoned and no longer maintained. No replacement package was suggested.

Riot API wrapper for Laravel

v4.1.0 2022-01-13 15:43 UTC

This package is auto-updated.

Last update: 2023-06-13 18:48:04 UTC


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

License

This package is open-sourced software licensed under the MIT license.