PHPackages                             communitydragon/phizz - 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. communitydragon/phizz

ActiveLibrary

communitydragon/phizz
=====================

An auto-generated PHP library for Riot API

0.0.1(2mo ago)061MITPHPPHP ^8.1CI failing

Since Mar 9Pushed 1mo agoCompare

[ Source](https://github.com/CommunityDragon/Phizz)[ Packagist](https://packagist.org/packages/communitydragon/phizz)[ Docs](https://github.com/communitydragon/phizz)[ GitHub Sponsors](https://github.com/communitydragon)[ RSS](/packages/communitydragon-phizz/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (15)Versions (2)Used By (0)

Phizz — Laravel client for the Riot Games API
=============================================

[](#phizz--laravel-client-for-the-riot-games-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9396054aac3be0d5ef0a23fda070fb31011081e2f41919f3173e26a0c6ef81b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6d6d756e697479647261676f6e2f7068697a7a2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/communitydragon/phizz)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4fed78ae6bdf78919a956892aa4f844fc997e4905f262fa80f01ab2176b1ee1d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d6d756e697479647261676f6e2f7068697a7a2f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/communitydragon/phizz/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c1c51794022c6e91a6759d86ee8281b5298e07619d71f42c885733c57bb06dfe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d6d756e697479647261676f6e2f7068697a7a2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/communitydragon/phizz/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/3411e26fad07d8000ce946297d8f70b8905f25356cd2b56f26a47076aa6f7e6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6d6d756e697479647261676f6e2f7068697a7a2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/communitydragon/phizz)

A type-safe, auto-generated Laravel client for the Riot Games API. Covers League of Legends, Teamfight Tactics, Legends of Runeterra, Valorant, and Riftbound — generated directly from official OpenAPI schemas with built-in caching, proactive rate limiting, and automatic regional routing.

Requirements
------------

[](#requirements)

- PHP `>= 8.1`
- Laravel `>= 10`

Installation
------------

[](#installation)

```
composer require communitydragon/phizz
```

Publish the config file:

```
php artisan vendor:publish --tag="phizz-config"
```

Add your Riot API key to `.env`:

```
RIOT_API_KEY=your-api-key-here
RIOT_DEFAULT_PLATFORM=na1
```

Usage
-----

[](#usage)

Access APIs through the `Phizz` facade. Each game exposes its own client.

```
use Phizz\Facades\Phizz;
use Phizz\Enums\Platform;
use Phizz\Enums\Regional;

// League of Legends
$match    = Phizz::lol()->matchV5->getMatch('EUW1_1234567890');
$summoner = Phizz::lol()->summonerV4->getByPuuid($puuid);
$mastery  = Phizz::lol()->championMasteryV4->getAllChampionMasteriesByPuuid($puuid);

// Per-call platform override
$match = Phizz::lol(Platform::EUW)->matchV5->getMatch('EUW1_1234567890');

// Teamfight Tactics
$tftMatch    = Phizz::tft()->matchV1->getMatch('EUW1_1234567890');
$tftLeague   = Phizz::tft()->leagueV1->getChallengerLeague();
$tftSummoner = Phizz::tft()->summonerV1->getByPuuid($puuid);

// Valorant
$valMatch       = Phizz::val()->matchV1->getMatch($matchId);
$valLeaderboard = Phizz::val()->rankedV1->getLeaderboard('e7a1');

// Legends of Runeterra
$lorMatch       = Phizz::lor()->matchV1->getMatch($matchId);
$lorLeaderboard = Phizz::lor()->rankedV1->getLeaderboards();

// Account (cross-game)
$account = Phizz::riot()->accountV1->getByRiotId(gameName: 'IAmTheWhite', tagLine: 'EUW');
```

### Bypassing the cache

[](#bypassing-the-cache)

Every API method accepts a `force` parameter. When `true`, the request always hits the network and the cache is skipped entirely — nothing is read from it and nothing is written to it.

```
// Always fetches fresh data, even when caching is enabled
$match = Phizz::lol()->matchV5->getMatch('EUW1_1234567890', force: true);
```

Caching
-------

[](#caching)

Caching is enabled by default and uses your application's default cache store. The TTL applied to each response is resolved in this order:

1. Per-method override in `config/phizz.php` under `cache.method[]`
2. Global default (`cache.default`, 60 seconds)

Per-method TTLs are configured using the `TTL` class, which provides a chained constant syntax:

```
use Phizz\TTL;

// config/phizz.php
'cache' => [
    'enabled' => env('RIOT_CACHE_ENABLED', true),
    'store'   => env('RIOT_CACHE_STORE', null),
    'default' => env('RIOT_CACHE_TTL', 60),
    'method'  => [
        TTL::lol::matchV5::getMatch           => 86400, // matches — cache for 24 h
        TTL::lol::matchV5::getTimeline        => 86400,
        TTL::lol::summonerV4::getByPuuid      => 3600,  // slow-changing — 1 h
        TTL::lol::leagueV4::getChallengerLeague => 300, // rankings — 5 min
        TTL::lol::spectatorV5::getCurrentGameInfoByPuuid => 30, // live game — 30 s
    ],
],
```

Sane defaults for all endpoints across every game are shipped in the published config.

Retry strategy
--------------

[](#retry-strategy)

Phizz automatically retries on `429` responses. Two built-in strategies are available:

```
use Phizz\Retry;

// Exponential backoff: 1 s, 2 s, 4 s, 8 s, ...  (default)
'retry' => ['strategy' => Retry::exponential()],

// Fixed delay between every attempt
'retry' => ['strategy' => Retry::fixed(seconds: 2)],
```

When a `Retry-After` header is present in the 429 response, Phizz always respects it over the configured strategy.

Rate limiting
-------------

[](#rate-limiting)

Phizz tracks Riot's `X-App-Rate-Limit` and `X-Method-Rate-Limit` response headers and sleeps proactively before sending requests that would otherwise trigger a 429. Rate limit state is stored in the configured cache store and scoped per platform and endpoint.

Platforms &amp; regions
-----------------------

[](#platforms--regions)

```
use Phizz\Enums\Platform;    // na1, euw1, kr, br1, jp1, ...
use Phizz\Enums\Regional;    // Americas, Europe, Asia, SEA
use Phizz\Enums\ValPlatform; // NA, EU, AP, KR, BR, LatAm, Esports
```

Endpoints that require a regional host (e.g. match history) automatically convert a `Platform` to the correct `Regional` value — `Platform::EUW` becomes `Regional::Europe` transparently.

Supported APIs
--------------

[](#supported-apis)

### Cross-game (`riot`)

[](#cross-game-riot)

APIVersionAccountV1### League of Legends (`lol`)

[](#league-of-legends-lol)

APIVersionChallengesV1Champion MasteryV4ChampionV3ClashV1League EXPV4LeagueV4MatchV5RSO MatchV1SpectatorV5StatusV4SummonerV4Tournament StubV5TournamentV5### Teamfight Tactics (`tft`)

[](#teamfight-tactics-tft)

APIVersionLeagueV1MatchV1SpectatorV5StatusV1SummonerV1### Valorant (`val`)

[](#valorant-val)

APIVersionConsole MatchV1Console RankedV1ContentV1MatchV1RankedV1StatusV1### Legends of Runeterra (`lor`)

[](#legends-of-runeterra-lor)

APIVersionDeckV1InventoryV1MatchV1RankedV1StatusV1### Riftbound (`riftbound`)

[](#riftbound-riftbound)

APIVersionContentV1Configuration reference
-----------------------

[](#configuration-reference)

```
// config/phizz.php
return [
    // Your Riot Games API key
    'api_key' => env('RIOT_API_KEY', ''),

    // Default platform used when none is specified per-call
    'default_platform' => env('RIOT_DEFAULT_PLATFORM', Platform::NA),

    // Maximum seconds to wait for a response before timing out
    'timeout' => env('RIOT_TIMEOUT', 60),

    // Retry strategy on 429 responses
    'retry' => [
        'strategy' => Retry::exponential(),
    ],

    // Response caching
    'cache' => [
        'enabled' => env('RIOT_CACHE_ENABLED', true),
        'store'   => env('RIOT_CACHE_STORE', null),   // null = app default
        'default' => env('RIOT_CACHE_TTL', 60),       // fallback TTL in seconds
        'method'  => [
            // Per-endpoint TTL overrides using TTL constants
            TTL::lol::matchV5::getMatch => 86400,
            // ...
        ],
    ],

    // Log all requests and responses (useful for debugging)
    'logging' => [
        'enabled' => env('RIOT_LOGGING_ENABLED', false),
    ],
];
```

Testing
-------

[](#testing)

```
composer test           # run the full test suite
composer test-coverage  # run tests with coverage report
composer analyse        # run PHPStan static analysis
composer format         # run Laravel Pint code formatter
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Sandi Karajic](https://github.com/skarajic)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance89

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e73492dd823acec301e5fb5c649e95e16e3dfa3136633e5833a1617dc9fc6de3?d=identicon)[SKarajic](/maintainers/SKarajic)

---

Top Contributors

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

---

Tags

laravelcommunitydragonphizz

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/communitydragon-phizz/health.svg)

```
[![Health](https://phpackages.com/badges/communitydragon-phizz/health.svg)](https://phpackages.com/packages/communitydragon-phizz)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[nativephp/mobile

NativePHP for Mobile

82724.0k43](/packages/nativephp-mobile)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)

PHPackages © 2026

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