Skip to content

Making Requests

Ben Sherred edited this page Dec 1, 2019 · 4 revisions

To make a request to the API, you can use one the following methods on an instance of Client:

  • $client->player(int $id): PlayerRequest
  • $client->bans(int $id): BanRequest
  • $client->servers(): ServerRequest
  • $client->gameTime(): GameTimeRequest
  • $client->companies(): CompaniesRequest
  • $client->company(int $id): CompanyRequest
  • $client->version(): VersionRequest
  • $client->rules(): RuleRequest

Getting the Data

Each request will either return a corresponding model or a collection of models. To get the model or collection you may call the get() method on the request.

Examples

  • $client->player('76561198154335536')->get() - this will return an instance the Player model

  • $client->servers()->get() - this will return an instance of ServerCollection