Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

blood72/laravel-riot-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Riot API

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.