json-nan/laravel-riot-lol-api

Package to facilitate the connection with the Riot Games API in LOL

v0.4.0 2024-03-06 21:26 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package is a wrapper for the Riot Games API in League of Legends, it is designed to facilitate the connection with the API and to be able to use the data in a more friendly way.

Requirements

Features

  • Get Summoner info
  • Get Player account info

Installation

You can install the package via composer:

composer require json-nan/laravel-riot-lol-api

You can publish the config file with:

php artisan vendor:publish --tag="laravel-riot-lol-api-config"

Configuration

It requires the following environment variables:

RIOT_LOL_API_KEY=

You can configure this optional environment variable:

RIOT_LOL_API_DOMAIN=
RIOT_LOL_REGION=
RIOT_LOL_PLATFORM=
RIOT_LOL_DATA_DRAGON_VERSION=

Usage

use JsonNaN\LaravelRiotLolApi\LaravelRiotLolApi;


$riotApi = new LaravelRiotLolApi();

$riotApi->getPlayerAccountByRiotId("Name#TAG")

Testing

For testing the library in your local environment you need to follow the next steps:

  • Go to tests/RiotLolApiTest.php
  • Fill the configuration variables from line 12 to 16
  • Remove ->skip() from the line 17
  • Run ./vendor/bin/pest

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.