1. Go to this page and download the library: Download m1so/leaguewrap library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
m1so / leaguewrap example snippets
use LeagueWrap\Client as RiotApi;
$api = new RiotApi('RGAPI-xxx', 'euw');
// The following calls produce the same results
$api->match()->getById($id);
$api->match()->byId($id);
// Support for batch calls (api->match()->byId($id);
$myGame['gameId'] === $id;
$myGame['teams.0.teamId'] === 100; // "dot" notation support for nested elements
// Redis backend with Predis client
// @see https://github.com/php-cache/predis-adapter
$client = new \Predis\Client('tcp:/127.0.0.1:6379');
$pool = new \Cache\Adapter\Predis\PredisCachePool($client);
$api->setAppLimits([
'10' => 100, // 100 requests per 10 seconds
], $pool);
// When using Laravel
$store = app(\Illuminate\Cache\Repository::class)->getStore();
$pool = new \Cache\Adapter\Illuminate\IlluminateCachePool($store);
$api->setLimits([
'10' => 100, // 100 requests per 10 seconds
], $pool);
/*
* Caching is very similar, infact the same pool can be shared with the rate-limiter.
*/
$api->addCache($pool);
$api->removeCache();