lukasz-adamski/laravel-teamspeak3

Teamspeak 3 PHP Framework Service Provider for Laravel Framework

1.0.4 2020-06-11 09:14 UTC

This package is auto-updated.

Last update: 2021-11-11 12:34:17 UTC


README

This package is developed to provide Laravel Framework service allowing you to execute TeamSpeak 3 ServerQuery commands.

Installation

  1. Install composer package using this command:
composer install lukasz-adamski/laravel-teamspeak3
  1. Insert Service Provider in config/app.php:
Adams\TeamSpeak3\TeamSpeak3ServiceProvider::class,
  1. Insert Facade in config/app.php:
'TeamSpeak3' => Adams\TeamSpeak3\Facades\TeamSpeak3::class,
  1. Publish configuration file to your project:
php artisan vendor:publish --provider="Adams\TeamSpeak3\TeamSpeak3ServiceProvider"
  1. Open .env file and insert these settings:
  • TEAMSPEAK3_HOST - host used to establish connection with server,
  • TEAMSPEAK3_VOICE_PORT - voice port (UDP) used to identify virtual server to select,
  • TEAMSPEAK3_QUERY_PORT - query port (TCP) used to establish connection with ServerQuery,
  • TEAMSPEAK3_USERNAME - username which will be used to login into ServerQuery,
  • TEAMSPEAK3_PASSWORD - password which will be used to login into ServerQuery,
  • TEAMSPEAK3_NICKNAME - nickname to set after successful connection.

Usage

For example you can use this Service Provider in Controllers:

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;

class TeamSpeak3Controller extends Controller
{
    /**
     * Show clients connected to TeamSpeak 3 server.
     *
     * @return Response
     */
    public function clients()
    {
        return view('teamspeak3.clients', [
            'clients' => TeamSpeak3::clientList()
        ]);
    }
}