定制 devtemple/lara-lol 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devtemple/lara-lol

Composer 安装命令:

composer require devtemple/lara-lol

包简介

This is a package, which help you work simplier with League of Legends API

README 文档

README

This is a Laravel package which let you faster getting data from League of Legends API.

Getting Started

Install this package with packagist.

Installing

Type with you terminal:

composer require devtemple/lara-lol

Set API key

Open your .env file and set a LARALOL_API_KEY which you can generate on the League of Legends developers API page

Options

You can export config files:

php artisan vendor:publish --tag=laralol-config

Default server:

default_server

Default season:

default_season

Possible is define server with every new call endpoint with function:

server($server)

ex.

use Devtemple\Laralol\Facades\Champion;

Champion::server('euw1')->get();

How use

League of Legends API giving use some endpoint to get different data from the RIOT servers.

Every call to endpoint require one function:

get($fields)

If you want, you can set attribute with fields you want get from the call. You can define array with fields or one field. You can set it empty and get all data from the endpoint.

ex.

get('field') or get(['field1', 'field2']) or get()

List of all fields for specific endpoints you can find on League of Legends API Full Reference

Champion

Champion endpoint let us get some data about champions. This endpoint don't have any specified for it functions.

ex.

use Devtemple\Laralol\Facades\Champion;

Champion::get();

Champion Mastery

Champion Mastery Endpoint let us get information about masteries champions for specified summoner. We have some functions which we can use for get some data.

This function let us get a scores for specified summoner ID

scores($summonerId);

This function give us information about scores for every summoner champion by summoner ID

masteries($summonerId);

This function give us information about scores for specific champion ID and summoner ID

masteriesByChampion($summonerId, $championId);

ex.

use Devtemple\Laralol\Facades\ChampionMastery;

ChampionMastery::scores($summonerId)->get();

or

ChampionMastery::masteries($summonerId)->get();

or

ChampionMastery::masteriesByChampion($summonerId, $championId);

League

League endpoint give you some data about challenger and masters leagues and leagues for specified summoners. You can do this with some specified functions.

This combination functions let you get information about challenger or master league:

tier($tier); // available options: master or chall

queue($queue); // available options: solo (RANKED_SOLO_5x5) or flex (RANKED_FLEX_SR) or flextt (RANKED_FLEX_TT)

league(); // is required to get specified league - check on examples to see how to use it

This function let you get league by league ID

findById($leagueId);

This function let you get leagues for specified summoner ID

findBySummonerId($summonerId);

ex.

use Devtemple\Laralol\Facades\League;

// You can get a challenger or master league for specified queue like this:
League::tier('chall')->queue('solo')->league()->get();

// Get league by league ID
League::findById($leagueId)->get();

// Find all leagues for specified summoner
League::findBySummonerId($summonerId)->get();

Lol Status

Lol Status endpoint give you information about specified server. This endpoint don't have any specified functions.

ex.

use Devtemple\Laralol\Facades\LolStatus;

LolStatus::get();

Match

Match endpoint give you some data about matches and timelines for specific match. This endpoint have a some specified functions.

Options which you can use is:

  • champion
  • season
  • queue
  • beginIndex
  • endIndex
  • beginTime
  • endTime

// Notice: Working with tournament code require specific policy for your API.

findByAccountId($accountId); // Receive matches for Account ID

findByMatchId($matchId); // Receive match for Match ID

findByTournamentCode($tournamentCode); // Receive matches by Tournament code

findByMatchIdAndTournamentCode($matchId, $tournamentCode); // Receive match by Match ID and Tournament code

timeline($matchId); // Receive timeline for specific Match ID

// With under function you can filter result you would get. How you can use it you can check in examples
season($season); // Data for specific users

champion($championId); // Data for specific champion ID

queue($queue); // Data for specific queue

beginIndex($beginIndex); // Start data from specific index

endIndex($endIndex); // End data for specific index

beginTime($beginTime); // Start data for specific date (You can define normal format, timestamp or carbon instance)

endTime($endTime); // End data for specific date (You can define normal format, timestamp or carbon instance)

or

options($options); // Array with specific options champion|season|queue|beginIndex|endIndex|beginTime|endTime

ex.

use Devtemple\Laralol\Facades\Match;

// Get matches for specific account ID
Match::findByAccountId($accountId)->get();

//  Get matches with specific functions options
Match::findByAccountId($accountId)
->season(10)
->beginIndex(10)
->endIndex(110)
->beginTime('12.01.2018' || $timestamp || Carbon::now()->subWeeks(12)) // Date between beginTime and endTime can't be more than one week
->endTime('15.01.2018' || $timestamp || Carbon::now()->subWeeks(12))
->get();

or

Match::findByAccountId($accountId)
->options([
    'season' => 10,
    'beginIndex' => 10,
    'endIndex' => 110
])
->get();

Spectator

Spectator endpoint give you some information about summoner if he is in game or give you featured games. You can take information with two specified functions.

This function return for you featured games:

featuredGames();

This function give you information if user is in game now:

findById($summonerId);

ex.

use Devtemple\Laralol\Facades\Spectator;

Spectator::featuredGames()->get();

or

Spectator::findById($summonerId)->get();

Summoner

Summoner endpoint let us get data about summoner like a account ID, summoner ID, name or icon ID. This endpoint has some functions which let us get awesome data from League of Legends API.

This functions let us get information about summoner:

findByName($name); // by his name

findByAccountId($id); // by his account id

findById($id); // by his ID

ex.

use Devtemple\Laralol\Facades\Summoner;

Summoner::findByName('Erring')->get();

or

Summoner::findByAccountId(29647586)->get();

or

Summoner::findById(25251096)->get();

Third Party Code

Third Party Code endpoint return for you third party code defined in the League of Legends Client. You can do this with one specified function.

This function give you third party code for specified summoner:

findById($summonerId);

ex.

use Devtemple\Laralol\Facades\ThirdPartyCode;

ThirdPartyCode::findById($summonerId)->get();

TOURNAMENT STUB

This endpoint let you work with Tournament codes and tournament matches. This is a stub for testing and only working on development LOL_API_KEY. If you want know to options, go on lol api reference and check what you can use.

This function give you tournament stub data:

providers($options); // Creates a tournament provider and returns its ID
tournaments($options); // Creates a tournament and returns its ID.
postCodes($tournamentId, $options, $count); // Create a tournament code for the given tournament
getLobbyEvents($tournamentCode); // Gets a list of lobby events by tournament code

TOURNAMENT

This endpoint let you use all functions from tournament stub endpoint and extra few functions. You need to remember if you want use this endpoint, you need a production LOL_API_KEY.

Check some additional functions:

putCodes($tournamentCode); // Update the pick type, map, spectator type, or allowed summoners for a code
getCodes($tournamentCode); // Returns the tournament code DTO associated with a tournament code string

Built With

  • Guzzle - Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

devtemple/lara-lol 适用场景与选型建议

devtemple/lara-lol 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 devtemple/lara-lol 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 devtemple/lara-lol 我们能提供哪些服务?
定制开发 / 二次开发

基于 devtemple/lara-lol 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-23