PHPackages                             timmsy/piltover-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. timmsy/piltover-client

ActiveLibrary[API Development](/categories/api)

timmsy/piltover-client
======================

Riot Games API wrapper with Laravel integration.

v1.1.2(6mo ago)01MITPHPPHP ^8.1CI failing

Since Oct 22Pushed 6mo agoCompare

[ Source](https://github.com/Timmsy1998/PiltoverClient)[ Packagist](https://packagist.org/packages/timmsy/piltover-client)[ Docs](https://github.com/Timmsy1998/PiltoverClient)[ RSS](/packages/timmsy-piltover-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (5)Used By (0)

🧠 PiltoverClient
================

[](#-piltoverclient)

> A PHP / Laravel-ready API wrapper for the **Riot Games Developer API**, built by **Timmsy**.

---

🚀 Overview
----------

[](#-overview)

PiltoverClient is a lightweight, framework-agnostic API client for the **Riot Games Developer API**. It integrates seamlessly with **Laravel** but can also be used in any PHP project.

The client implements the modern Riot API flow:

- 🔹 Resolve players via **account-v1** using their Riot ID (`gameName` + `tagLine`)
- 🔹 Use **PUUID** to fetch summoner profiles, matches, and more
- 🔹 Automatically maps platform → regional clusters (EUW → EUROPE, NA → AMERICAS, etc.)
- 🔹 Provides Laravel Facade + helper for elegant usage
- 🔹 Fully PSR-compliant, Guzzle-powered

---

⚙️ Installation
---------------

[](#️-installation)

```
composer require timmsy/piltover-client
```

---

🧩 Laravel Setup
---------------

[](#-laravel-setup)

If you're using Laravel, PiltoverClient auto-discovers its service provider and facade.

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag=piltover-config
```

### Add to `.env`

[](#add-to-env)

```
RIOT_API_KEY=your_api_key_here
RIOT_PLATFORM=euw1
# Optional (will be derived automatically if omitted)
# RIOT_REGIONAL=europe

```

---

💻 Usage Examples
----------------

[](#-usage-examples)

### 🔸 Laravel Facade

[](#-laravel-facade)

```
use Timmsy\PiltoverClient\Facades\Piltover;

// 1. Get Account Info by Riot ID
$account = Piltover::accountByRiotId('TheCHEF', 'EUW');

// 2. Get Summoner Info using PUUID
$puuid = $account['puuid'] ?? null;
$summoner = $puuid ? Piltover::summonerByPuuid($puuid) : null;

// 3. Get Matches using PUUID
$matches = $puuid ? Piltover::matchesByPuuid($puuid, ['count' => 5]) : [];

// 4. Get Single Match Details
$match = !empty($matches) ? Piltover::matchById($matches[0]) : null;
```

### 🔸 Standalone PHP

[](#-standalone-php)

```
use Timmsy\PiltoverClient\Http\RiotClient;

$client = new RiotClient('your_api_key', 'euw1');
$acct = $client->accountByRiotId('TheCHEF', 'EUW');
print_r($acct);
```

---

🧭 Supported Endpoints
---------------------

[](#-supported-endpoints)

EndpointScopeMethodDescription`/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}`Regional`accountByRiotId()`Get player account and PUUID`/lol/summoner/v4/summoners/by-puuid/{puuid}`Platform`summonerByPuuid()`Get Summoner info`/lol/match/v5/matches/by-puuid/{puuid}/ids`Regional`matchesByPuuid()`Get recent match IDs`/lol/match/v5/matches/{matchId}`Regional`matchById()`Get full match details---

🧰 Helpers
---------

[](#-helpers)

```
piltover()->matchById('EUW1_123456789');
```

---

🧪 Testing
---------

[](#-testing)

```
composer test
```

Includes PHPUnit + Orchestra Testbench for Laravel context tests.

---

⚙️ Config File (`config/piltover.php`)
--------------------------------------

[](#️-config-file-configpiltoverphp)

```
return [
    'api_key'  => env('RIOT_API_KEY'),
    'platform' => env('RIOT_PLATFORM', 'euw1'),
    'regional' => env('RIOT_REGIONAL', null),
    'base_urls' => [
        'platform' => 'https://{platform}.api.riotgames.com',
        'regional' => 'https://{regional}.api.riotgames.com',
    ],
    'timeout' => 10,
];
```

---

📚 API Documentation
-------------------

[](#-api-documentation)

PiltoverClient includes a built-in **OpenAPI 3.1** specification and **ReDoc-powered** documentation viewer. This allows developers to explore all supported Riot Games API endpoints visually.

---

### 🔧 Laravel Integration

[](#-laravel-integration)

Once installed in a Laravel app, the docs are automatically available at:

- **ReDoc UI:** [`/piltover/docs`](http://your-app.test/piltover/docs)
- **Raw Spec:** [`/piltover/docs/openapi.json`](http://your-app.test/piltover/docs/openapi.json)

Configure in `config/piltover.php` or `.env`:

```
PILTOVER_DOCS_ENABLED=true
PILTOVER_DOCS_PATH=piltover/docs
PILTOVER_SPEC_PATH=piltover/docs/openapi.json
```

Optional authentication:

```
'middleware' => ['web', 'auth'],
```

---

### 🧩 Standalone Mode

[](#-standalone-mode)

PiltoverClient also ships with a local static docs server:

```
composer docs:serve
```

Visit: This uses the same OpenAPI spec from `resources/openapi/`.

---

### 🧠 OpenAPI Overview

[](#-openapi-overview)

The included spec documents:

EndpointScopeMethodDescription`/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}`RegionalGETRetrieve account + PUUID by Riot ID`/lol/summoner/v4/summoners/by-puuid/{puuid}`PlatformGETFetch Summoner profile by PUUID`/lol/match/v5/matches/by-puuid/{puuid}/ids`RegionalGETList recent matches by PUUID`/lol/match/v5/matches/{matchId}`RegionalGETRetrieve match details---

### 🧾 Notes

[](#-notes)

- Works both in Laravel and standalone PHP contexts.
- Fully PSR-4 compliant — no runtime dependencies beyond `illuminate/support` and `guzzle`.
- You can extend the `resources/openapi/openapi.yaml` spec as you add endpoints.

---

📦 Future Roadmap
----------------

[](#-future-roadmap)

- Add all Riot endpoints (League, Spectator, Champion)
- Rate-limit &amp; retry middleware
- Data Dragon (champions, icons, maps)
- Cached responses
- CLI utilities for dev testing

---

📜 License
---------

[](#-license)

MIT License © 2025 **James Timms**Created and maintained by [@Timmsy1998](https://github.com/Timmsy1998)

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance70

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

198d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d286840302529ac81ca7d6c6e6ffa0c30c9602f6b0a2c84c670a34599edc338?d=identicon)[Timmsy](/maintainers/Timmsy)

---

Top Contributors

[![Timmsy1998](https://avatars.githubusercontent.com/u/59345798?v=4)](https://github.com/Timmsy1998 "Timmsy1998 (4 commits)")

---

Tags

apiapi-clientlaravel-packageleague-of-legendsleagueoflegendspiltoverriot-gamesriot-games-apiphpcomposerapiclientlaravelopenapileague of legendsdocsredocRiot

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timmsy-piltover-client/health.svg)

```
[![Health](https://phpackages.com/badges/timmsy-piltover-client/health.svg)](https://phpackages.com/packages/timmsy-piltover-client)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[juststeveking/laravel-redoc

A simple API documentation package for Laravel using OpenAPI and Redoc

92289.9k1](/packages/juststeveking-laravel-redoc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
