Skip to content

Laravel integration for par0noid's ts3admin.class

License

Notifications You must be signed in to change notification settings

alessiobrendt/laravel-ts3admin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-ts3admin

par0noid's ts3admin.class integration for Laravel 5.5 and higher

INFO: This package uses a singleton to access a single ts3admin.class-object. So you currently can't access multiple TeamSpeak-3-Servers!

Supported Laravel Versions

Laravel Version Supported
5.5 - 5.8 ✔️
6.0 ✔️

Installation

This package will be autodiscovered, so no further setup is needed.

composer require micky5991/laravel-ts3admin

Configuration

Copy configuration to config-folder:

$ php artisan vendor:publish --provider=Micky5991\laravel_ts3admin\Providers\TeamspeakServiceProvider

Add environmental variables to your .env

TS_SERVER_HOST=127.0.0.1
TS_SERVER_PORT=9987
TS_SERVER_TIMEOUT=2
TS_QUERY_PORT=10011
TS_QUERY_USERNAME=serveradmin
TS_QUERY_PASSWORD=supersecretpassword

After completing all steps from above you should have a configuration file under: config/teamspeak.php. There you can configure some other aspects like the name of the ServerQuery.

Example

An example for a controller to the /clients endpoint that lists all connected clients.

Route::get('/users', function(\ts3admin $ts) {
    $result = $ts->clientList();
    if($ts->succeeded($result)) {
        $users = $ts->getElement("data", $result);
        dd($users);
    } else {
        return "Connection failed";
    }
});

About

Laravel integration for par0noid's ts3admin.class

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%