Search by

fkrzski / laravel-steam-api-sdk

fkrzski

Laravel bridge for fkrzski/php-steam-api-sdk — service provider, Steam facade and test fakes for the Steam Web API.

Package info

github.com/fkrzski/laravel-steam-api-sdk

pkg:composer/fkrzski/laravel-steam-api-sdk

Fund package maintenance!

fkrzski

Statistics

Installs: 1 334

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

0.9.0 2026-10-14 05:56 UTC

README

Laravel Steam API SDK — composer require fkrzski/laravel-steam-api-sdk

License Latest Version on Packagist Total Downloads Tests

Laravel bridge for fkrzski/php-steam-api-sdk. Ships a service provider, a Steam facade and a Steam::fake() test helper so you can talk to the Steam Web API the Laravel way.

It powers the player stats on Dead by Stats.

  • Auto-discovered SteamConnector binding, scoped per request and safe under Octane.
  • Rate limits shared across processes through a Laravel cache store of your choosing — Steam's daily quota or your own, with a cool-down after a 429.
  • Timeouts and retries from the config file, and queue middleware that holds a job back once a limit is spent.
  • Requests through Guzzle, reported to Laravel Nightwatch while it is enabled, or through any Saloon sender the container builds.
  • Fluent Steam facade over the SDK's resources — Steam::users()->summaries(...) and the rest — plus a lazy news feed.
  • Laravel events for every Steam request, response and failure, and a log channel built on them.
  • Localised payloads follow your application locale, or the language you pin in config.
  • AsSteamId Eloquent cast, SteamIdRule validation rule and one-liner test fakes that mirror the resources — Steam::fake()->users()->summaries(...) — with DTO factories for the payloads.

Requirements

  • PHP 8.5+
  • Laravel 13+

Installation

composer require fkrzski/laravel-steam-api-sdk

The service provider and Steam facade are auto-discovered. Run the installer to publish the config and store your key:

php artisan steam:install

It writes config/steam-api.php and asks for your Steam Web API key, appending it to .env. Both steps are also fine to do by hand:

php artisan vendor:publish --tag=steam-api-config
STEAM_API_KEY=your-steam-web-api-key

Quick start

use Fkrzski\LaravelSteamApiSdk\Facades\Steam;
use Fkrzski\SteamApiSdk\ValueObjects\SteamId;

$id = SteamId::fromSteamId64('76561198000000000');

$summaries    = Steam::users()->summaries([$id]);
$bans         = Steam::users()->bans([$id]);
$friends      = Steam::users()->friends($id);
$groups       = Steam::users()->groups($id);
$resolvedId   = Steam::users()->resolveVanityUrl('gabelogannewell');
$library      = Steam::players()->ownedGames($id, appIdsFilter: [381210]);
$recentGames  = Steam::players()->recentlyPlayedGames($id);
$level        = Steam::players()->steamLevel($id);
$badges       = Steam::players()->badges($id);
$quests       = Steam::players()->communityBadgeProgress($id);
$stats        = Steam::stats()->userStats($id, appId: 381210);
$achievements = Steam::stats()->achievements($id, appId: 381210);
$playing      = Steam::stats()->currentPlayers(appId: 381210);
$globalStats  = Steam::stats()->globalAchievements(gameId: 381210);
$gameSchema   = Steam::stats()->schema(appId: 381210);
$versionCheck = Steam::apps()->upToDateCheck(appId: 440, version: $installedVersion);
$servers      = Steam::apps()->serversAtAddress('108.181.62.21');
$relayNetwork = Steam::apps()->sdrConfig(appId: 730);
$news         = Steam::news()->appNews(appId: 440);
$newsFeed     = Steam::newsFeed(appId: 440);
$serverTime   = Steam::webApi()->serverTime();
$webApis      = Steam::webApi()->supportedApis();

Each resource method returns a strongly-typed DTO from the underlying SDK — you never touch raw JSON.

Documentation

Full documentation lives at docs.fkrzski.dev/laravel-steam-api-sdk:

  • Guide — the SteamId value object, the resources, exceptions, and concurrent requests.
  • Configuration — the config file, your API key, timeouts and retries, the HTTP sender and Nightwatch.
  • Rate limiting — the daily budget, limits of your own, the 429 cool-down and queued jobs.
  • API reference — every resource and facade method, its parameters, return type, and errors.
  • Eloquent cast — persist a Steam ID on a model with AsSteamId.
  • Route binding — opt in to resolving a {steamId} route parameter into a SteamId value object.
  • Validation rule — validate submitted Steam IDs with SteamIdRule.
  • Events — listen to Steam requests, responses and failures through Laravel events.
  • Logging — log failed Steam calls, and every response if you ask, to a channel of yours.
  • Testing — fake the Steam Web API with Steam::fake().

License

MIT. See LICENSE.md.