The Laravel bridge for fkrzski/php-steam-api-sdk:
a service provider, a fluent Steam facade, and a Steam::fake() test helper for
the Steam Web API — no connector wiring, no raw
JSON. It powers the player stats on
Dead by Stats.
Why laravel-steam-api-sdk
Section titled “Why laravel-steam-api-sdk”- Auto-discovered facade — the
Steamfacade and itsSteamConnectorbinding register themselves, scoped per request and safe under Octane. - Shared rate limits — Steam’s daily quota, or limits of your own, counted in a Laravel cache store you pick, so every process draws on one counter.
- Timeouts and retries — set in the config file; Steam unreachable or answering a
5xxis tried again, every other failure is thrown at once. - Pluggable sender — requests go out through Guzzle, reported to Nightwatch while it is enabled, or through any Saloon sender the container builds.
- Queue middleware —
RespectsSteamRateLimitreleases a job until the spent limit’s window resets rather than letting it fail. - Fluent resources —
Steam::users()->summaries(),Steam::players()->ownedGames()and the rest return typed DTOs, andSteam::newsFeed()pages an app’s news lazily. - Locale-aware language — localised payloads follow
app()->getLocale()through Steam’s own language codes, or the one you pin in the config file. - Eloquent cast —
AsSteamIdstores a Steam ID on a model and reads it back as aSteamIdvalue object. - Route binding — opt in and a
{steamId}route parameter arrives as aSteamId, with a 404 on unresolvable input. - Events and logging — every Steam request, response and failure is a Laravel event, and a log channel you name records the failures.
- Renderable exceptions — an unhandled Steam failure answers with the status it maps to, and never with the one Steam sent for a key of yours it rejected.
- Validation rule —
SteamIdRulevalidates a submitted ID or profile URL without touching the API. - One-liner fakes —
Steam::fake()->users()->summaries()fakes an endpoint the way your code calls it, with DTO factories for the payloads, andSteam::assertSent()for the requests that went out.
Requirements
Section titled “Requirements”- PHP 8.5+
- Laravel 13+
Installation
Section titled “Installation”-
Pull the package in — the service provider and facade are auto-discovered:
Terminal window composer require fkrzski/laravel-steam-api-sdk -
Publish the config and store your key:
Terminal window php artisan steam:install -
Check what the package sees:
Terminal window php artisan about --only=steam_api
Quickstart
Section titled “Quickstart”use Fkrzski\LaravelSteamApiSdk\Facades\Steam;use Fkrzski\SteamApiSdk\ValueObjects\SteamId;
$id = SteamId::fromSteamId64('76561198000000000');
$summaries = Steam::users()->summaries([$id]);
echo $summaries[0]->personaName;Every resource sends its request through the shared connector and hands back the readonly DTO — you never touch the Saloon response.