1010[ ![ License] ( https://poser.pugx.org/syntax/steam-api/license.svg )] ( https://packagist.org/packages/syntax/steam-api )
1111
1212** Version Support**
13- ` Laravel >= 6 .0 `
14- ` PHP >= 7.3.0 `
13+ ` Laravel >= 10 .0 `
14+ ` PHP >= 8.1 `
1515
1616- [ Installation] ( #installation )
1717- [ Usage] ( #usage )
@@ -30,7 +30,7 @@ This package provides an easy way to get details from the Steam API service. Th
3030Begin by installing this package with composer.
3131
3232 "require": {
33- "syntax/steam-api": "2. 3.*"
33+ "syntax/steam-api": "3.*"
3434 }
3535
3636Next, update composer from the terminal.
@@ -41,10 +41,19 @@ Next, update composer from the terminal.
4141
4242Lastly, publish the config file. You can get your API key from [ Steam] ( http://steamcommunity.com/dev/apikey ) .
4343
44- php artisan vendor:publish
44+ php artisan vendor:publish --provider="Syntax\SteamApi\SteamApiServiceProvider"
4545
4646## Usage
4747
48+ ``` php
49+ use Syntax\SteamApi\Facades\SteamApi;
50+
51+ /** Get Portal 2 */
52+ $apps = SteamApi::app()->appDetails([620]);
53+
54+ echo $app->first()->name;
55+ ```
56+
4857Each service from the Steam API has its own methods you can use.
4958
5059- [ Global] ( #global )
@@ -75,7 +84,7 @@ format | string | The format you want back. | No | null
7584##### Example usage
7685
7786``` php
78- Steam ::convertId($id, $format);
87+ SteamApi ::convertId($id, $format);
7988```
8089
8190> Example Output: [ convertId] ( ./examples/global/convertId.txt )
@@ -84,7 +93,7 @@ Steam::convertId($id, $format);
8493The [ Steam News] ( https://developer.valvesoftware.com/wiki/Steam_Web_API#GetNewsForApp_.28v0002.29 ) web api is used to get articles for games.
8594
8695``` php
87- Steam ::news()
96+ SteamApi ::news()
8897```
8998
9099#### GetNewsForApp
@@ -102,7 +111,7 @@ maxlength | int | The maximum number of characters to return | No | null
102111
103112``` php
104113<?php
105- $news = Steam ::news()->GetNewsForApp($appId, 5, 500)->newsitems;
114+ $news = SteamApi ::news()->GetNewsForApp($appId, 5, 500)->newsitems;
106115?>
107116```
108117
@@ -114,7 +123,7 @@ The [Player Service](https://developer.valvesoftware.com/wiki/Steam_Web_API#GetO
114123When instantiating the player class, you are required to pass a steamId or Steam community ID.
115124
116125``` php
117- Steam ::player($steamId)
126+ SteamApi ::player($steamId)
118127```
119128
120129#### GetSteamLevel
@@ -178,7 +187,7 @@ The [User](https://developer.valvesoftware.com/wiki/Steam_Web_API#GetFriendList_
178187When instantiating the user class, you are required to pass at least one steamId or steam community ID.
179188
180189``` php
181- Steam ::user($steamId)
190+ SteamApi ::user($steamId)
182191```
183192
184193#### ResolveVanityURL
@@ -191,7 +200,7 @@ Name | Type | Description | Required | Default
191200displayName| string | The display name to get the steam ID for. In ` http://steamcommunity.com/id/gabelogannewell ` it would be ` gabelogannewell ` . | Yes | NULL
192201
193202``` php
194- $player = Steam ::user($steamId)->ResolveVanityURL('gabelogannewell');
203+ $player = SteamApi ::user($steamId)->ResolveVanityURL('gabelogannewell');
195204```
196205
197206> Example Output: [ ResolveVanityURL] ( ./examples/user/ResolveVanityURL.txt )
@@ -208,11 +217,11 @@ steamId| int[] | An array of (or singular) steam ID(s) to get details for | No
208217``` php
209218 // One user
210219 $steamId = 76561197960287930;
211- $player = Steam ::user($steamId)->GetPlayerSummaries()[0];
220+ $player = SteamApi ::user($steamId)->GetPlayerSummaries()[0];
212221
213222 // Several users
214223 $steamIds = [76561197960287930, 76561197968575517]
215- $players = Steam ::user($steamIds)->GetPlayerSummaries();
224+ $players = SteamApi ::user($steamIds)->GetPlayerSummaries();
216225```
217226
218227> Example Output: [ GetPlayerSummaries] ( ./examples/user/GetPlayerSummaries.txt )
@@ -250,7 +259,7 @@ The [User Stats](https://developer.valvesoftware.com/wiki/Steam_Web_API#GetPlaye
250259When instantiating the user stats class, you are required to pass a steamID or Steam community ID.
251260
252261``` php
253- Steam ::userStats($steamId)
262+ SteamApi ::userStats($steamId)
254263```
255264
256265#### GetPlayerAchievements
@@ -306,7 +315,7 @@ appId| int | The ID of the game you want the details for. | Yes |
306315This area will get details for games.
307316
308317``` php
309- Steam ::app()
318+ SteamApi ::app()
310319```
311320
312321#### appDetails
@@ -332,7 +341,7 @@ This method will return an array of app objects directly from Steam. It include
332341This method will get details for packages.
333342
334343``` php
335- Steam ::package()
344+ SteamApi ::package()
336345```
337346
338347#### packageDetails
@@ -353,7 +362,7 @@ l | string | The l is the language parameter, you can get the appropriate langua
353362This method will get user inventory for item.
354363
355364``` php
356- Steam ::item()
365+ SteamApi ::item()
357366```
358367
359368#### GetPlayerItems
@@ -374,7 +383,7 @@ steamid | int | The steamid of the Steam user you want for | Yes |
374383This service is used to get details on a Steam group.
375384
376385``` php
377- Steam ::group()
386+ SteamApi ::group()
378387```
379388
380389#### GetGroupSummary
@@ -390,7 +399,7 @@ group| string or int | The ID or the name of the group. | Yes
390399
391400``` php
392401<?php
393- $news = Steam ::group()->GetGroupSummary('Valve');
402+ $news = SteamApi ::group()->GetGroupSummary('Valve');
394403?>
395404```
396405
@@ -402,20 +411,23 @@ A Steam API key must be provided or most tests will fail.
402411
403412** Run Tests**
404413```
414+ # Build container
415+ docker-compose build
416+
405417# Install dependancies
406- docker-compose run php composer install
418+ docker-compose run --rm php composer install
407419
408420# Run tests (assumes apiKey is set in .env file)
409- docker-compose run php composer test
421+ docker-compose run --rm php composer test
410422
411423# Or with the apiKey inline
412- docker-compose run -e api=YOUR_STEAM_API_KEY php composer test
424+ docker-compose run --rm - e api=YOUR_STEAM_API_KEY php composer test
413425
414426# With coverage
415- docker-compose run php composer coverage
427+ docker-compose run --rm php composer coverage
416428
417429# Play around
418- docker-compose run php bash
430+ docker-compose run --rm php bash
419431```
420432
421433## Contributors
0 commit comments