PHPackages                             hugojf/csgo-server-api-laravel - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. hugojf/csgo-server-api-laravel

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hugojf/csgo-server-api-laravel
==============================

A simple way to communicate with CS:GO servers.

v2.0(6y ago)262[1 issues](https://github.com/HugoJF/csgo-server-api-laravel/issues)GPL-3.0-onlyPHPCI failing

Since Nov 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/HugoJF/csgo-server-api-laravel)[ Packagist](https://packagist.org/packages/hugojf/csgo-server-api-laravel)[ RSS](/packages/hugojf-csgo-server-api-laravel/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (4)Used By (0)

CS:GO Server API - Laravel package
==================================

[](#csgo-server-api---laravel-package)

Laravel package to interface [CS:GO Server API](https://github.com/HugoJF/csgo-server-api).

[![Build Status](https://camo.githubusercontent.com/452774ce8fbe866ed19cb6d81e5e9c1b0e902e214eb3d0f87c1c4839c157e5ff/68747470733a2f2f7472617669732d63692e6f72672f4875676f4a462f6373676f2d7365727665722d6170692d6c61726176656c2e7376673f6272616e63683d76322e30)](https://travis-ci.org/HugoJF/csgo-server-api-laravel)[![Coverage Status](https://camo.githubusercontent.com/37d84ce224a63b10d405fcb45c0cce3d81e282ef30a8d7c4f3a4cc43e7546522/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4875676f4a462f6373676f2d7365727665722d6170692d6c61726176656c2f62616467652e7376673f6272616e63683d76322e30)](https://coveralls.io/github/HugoJF/csgo-server-api-laravel?branch=v2.0)

How it works
------------

[](#how-it-works)

This package interfaces [my CS:GO API](https://github.com/HugoJF/csgo-server-api) main endpoints:

`/send` which you can send a command, with a delay to a single server;

`/sendAll` which you can send a command, with a delay to all servers controlled by the API;

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

[](#requirements)

- PHP 7.\*
- [CS:GO Server API](https://github.com/HugoJF/csgo-server-api) installation

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

[](#installation)

Using Composer, run:

`composer require hugojf/csgo-server-api-laravel`

Publish config:

`php artisan vendor:publish --provider="hugojf\CsgoServerApi\Providers\PackageServiceProvider"`

Configuration
-------------

[](#configuration)

Any configuration can be modified inside `configs/csgo-api.php`

#### `CSGO_API_URL=http://my-csgo-server-api.com/`

[](#csgo_api_urlhttpmy-csgo-server-apicom)

API server endpoint URL.

#### `CSGO_API_KEY=abcdef123456`

[](#csgo_api_keyabcdef123456)

API server authentication key.

Usage
-----

[](#usage)

#### Creating a command

[](#creating-a-command)

```
$myCommand = new Command($command, $delay = 0, $wait = false);
```

###### Parameters

[](#parameters)

- `$command` is the command to be executed;
- `$delay` tells how long the API should wait before sending the command;
- `$wait` tells the API to wait for server response before responding the request.

###### Examples

[](#examples)

```
// Get server stats
$statsCommand = new Command('stats', 0,  true);

// Kick bots
$botsCommand = new Command('bot_kick');

// Schedule say message
$sayCommand = new Command('say Hi!', 30000)
```

#### Creating a server

[](#creating-a-server)

```
$myServer = new Server($address, $port);
```

###### Parameters

[](#parameters-1)

- `$address` is the full address or just IP;
- `$port` is the server port.

###### Examples

[](#examples-1)

```
// Using IP and Port
$server1 = new Server('177.54.150.15', 27001);

// Using full address
$server2 = new Server('177.54.150.15:27002');
```

#### Sending a list of commands to a list of servers

[](#sending-a-list-of-commands-to-a-list-of-servers)

```
// Sends `stats` and `status` to both servers
//
// You can replace `direct` with `to`, they are the same
CsgoApi::direct(ByCommandSummary::class)->addCommand([
    new Command('stats', 1500, true),
    new Command('status', 1500, true),
])->addServer(
    new Server('177.54.150.15:27001'),
    new Server('177.54.150.15:27002'),
)->send();

// Expected response:
//  [
//      "stats"  => [
//          "177.54.150.15:27001" => "response-1",
//          "177.54.150.15:27001" => "response-2",
//      ],
//      "status" => [
//          "177.54.150.15:27001" => "response-3",
//          "177.54.150.15:27001" => "response-4",
//      ],
//   ]
```

#### Broadcasting a list of commands to all servers controlled by the API

[](#broadcasting-a-list-of-commands-to-all-servers-controlled-by-the-api)

```
// Sends `say` and `quit` to all servers
//
// You can replace `broadcast` with ``, they are the same
CsgoApi::broadcast(ByCommandSummary::class)->addCommand([
    new Command('say "Closing server for maintenance in 30 seconds', 0),
    new Command('say "Closing server for maintenance in 15 seconds', 15000),
    new Command('say "Closing server for maintenance in 5 seconds', 25000),
    new Command('quit', 30000),
])->send();
```

#### Different ways you can add commands or servers

[](#different-ways-you-can-add-commands-or-servers)

In an attempt to avoid instantiating every server or command, you can use the following formats:

###### Servers

[](#servers)

```
// Creating a DirectSender
$sender = CsgoApi::direct();

// Using full Server object
//
// All 4 methods are identical, use what feels right
$sender->addServer(new Server('177.54.150.15:27001'));
$sender->addServers(new Server('177.54.150.15:27001'));
$sender->server(new Server('177.54.150.15:27001'));
$sender->servers(new Server('177.54.150.15:27001'));

// Using list of Server objects
$sender->addServer([
    new Server('177.54.150.15:27001'),
    new Server('177.54.150.15:27002'),
]);

// Using string address
$sender->addServer('177.54.150.15:27002');

// Using list of string addresses
$sender->addServer([
    '177.54.150.15:27001',
    '177.54.150.15:27002',
]);

// Using IP and Port separately
$sender->addServer('177.54.150.15', 27002);

// Using list of IP and Ports
$sender->addServer([
    ['177.54.150.15', 27001],
    ['177.54.150.15', 27002],
]);
```

###### Commands

[](#commands)

```
// Creating a DirectSender
$sender = CsgoApi::direct();

// Using full Command object
//
// All 4 methods are identical, use what feels right
$sender->addCommand(new Command('stats', 1000, false));
$sender->addCommands(new Command('stats', 1000, false));
$sender->command(new Command('stats', 1000, false));
$sender->commands(new Command('stats', 1000, false));

// Using list of Command objects
$sender->addCommandItem([
    new Command('stats', 1500, false),
    new Command('status', 1500, false),
]);

// Using command parameters directly
$sender->addCommand('stats', 1500, false);

// Using list of command parameters
$sender->addCommand([
    ['stats', '1500', false],
    ['status', '1500', false],
]);
```

#### Changing summary class

[](#changing-summary-class)

You can change the way responses are grouped by passing a new Summary class

###### `ByCommandSummary::class`

[](#bycommandsummaryclass)

Groups responses by command first and then server after.

```
// Example response
//  [
//      "stats"  => [
//          "177.54.150.15:27001" => "response-1",
//          "177.54.150.15:27002" => "response-2",
//      ],
//      "status" => [
//          "177.54.150.15:27001" => "response-3",
//          "177.54.150.15:27002" => "response-4",
//      ],
//   ]
```

###### `ByServerSummary::class`

[](#byserversummaryclass)

Groups responses by server first and then command after.

```
// Example response
//  [
//      "177.54.150.15:27001"  => [
//          "stats" => "response-1",
//          "status" => "response-3",
//      ],
//      "177.54.150.15:27002" => [
//          "stats" => "response-2",
//          "status" => "response-4",
//      ],
//   ]
```

###### Example

[](#example)

```
$directByCommandSender = CsGoApi::direct(ByCommandSummary::class);
$directByServerSender = CsGoApi::direct(ByServerCummary::class);

$broadcastByCommandSender = CsGoApi::broadcast(ByCommandSummary::class);
$broadcastByServerSender = CsGoApi::broadcast(ByServerCummary::class);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~1 days

Total

3

Last Release

2380d ago

Major Versions

v1.0.4 → v2.0.x-dev2019-11-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/380670d6a0af4460abf5faeb9fdb4ad87e98bf8d64d4ef41bd1ab1fb7dc28298?d=identicon)[HugoJF](/maintainers/HugoJF)

---

Top Contributors

[![HugoJF](https://avatars.githubusercontent.com/u/1527438?v=4)](https://github.com/HugoJF "HugoJF (53 commits)")

---

Tags

csgocsgo-server-apilaravellaravel-package

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hugojf-csgo-server-api-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/hugojf-csgo-server-api-laravel/health.svg)](https://phpackages.com/packages/hugojf-csgo-server-api-laravel)
```

###  Alternatives

[binaryk/laravel-restify

Laravel REST API helpers

651399.1k](/packages/binaryk-laravel-restify)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[lomkit/laravel-rest-api

A package to build quick and robust rest api for the Laravel framework.

59152.2k](/packages/lomkit-laravel-rest-api)[wirechat/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

5434.7k](/packages/wirechat-wirechat)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[georgeboot/laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets

10435.5k](/packages/georgeboot-laravel-echo-api-gateway)

PHPackages © 2026

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