A PHP client library for integrating with the Nexusggr and Telo APIs, providing a simple interface for gaming operations.
- PHP 8.2 or higher
- Composer
- PHP extensions: curl, json
You can install the package via composer:
composer require kevindoni/nexusggrFor Laravel applications, the service provider will automatically register itself.
You can publish the config file with:
php artisan vendor:publish --provider="Kevindoni\Nexusggr\NexusggrServiceProvider" --tag="config"Configure the client using environment variables in your .env file:
NEXUSGGR_AGENT=your_agent_code
NEXUSGGR_TOKEN=your_agent_token
NEXUSGGR_ENDPOINT=https://api.nexusggr.comAlternatively, you can pass configuration directly when instantiating the client:
$client = new Kevindoni\Nexusggr\Nexusggr(
'your_agent_code',
'your_agent_token',
'https://api.nexusggr.com'
);Configure the Telo client using environment variables in your .env file:
TELO_AGENT=your_agent_code
TELO_TOKEN=your_agent_token
TELO_ENDPOINT=https://api.telo.is/api/v2Alternatively, you can pass configuration directly when instantiating the client:
$client = new Kevindoni\Nexusggr\Telo(
'your_agent_code',
'your_agent_token',
'https://api.telo.is/api/v2'
);You can also store credentials in a database and retrieve them when instantiating the client:
// Example using Laravel's DB facade
$credentials = DB::table('api_credentials')->where('name', 'nexusggr')->first();
$client = new Kevindoni\Nexusggr\Nexusggr(
$credentials->agent_code,
$credentials->agent_token,
$credentials->endpoint
);
// Or update credentials later using setConfig method
$client->setConfig(
$credentials->agent_code,
$credentials->agent_token,
$credentials->endpoint
);Recommended database structure:
CREATE TABLE api_credentials (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
agent_code VARCHAR(100) NOT NULL,
agent_token VARCHAR(100) NOT NULL,
endpoint VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);// Initialize the client
$nexus = new Kevindoni\Nexusggr\Nexusggr();
// User management
$userInfo = $nexus->info('username');
$register = $nexus->register('new_username');
$deposit = $nexus->transaction('username', 'deposit', 10000, 'unique_id_123');
// Game operations
$providers = $nexus->providers();
$games = $nexus->games('PRAGMATIC');
$launch = $nexus->launchGame('username', 'PRAGMATIC', 'vs20doghouse', 'en');
// Advanced features
$rtp = $nexus->controlUserRtp('username', 'PRAGMATIC', 92);
$scatterList = $nexus->callScatterList('PRAGMATIC', 'vs20doghouse');// Initialize the client
$telo = new Kevindoni\Nexusggr\Telo();
// User management
$userInfo = $telo->info('username');
$newUser = $telo->createUser('new_username');
$deposit = $telo->deposit('username', 10000);
// Game operations
$providers = $telo->providers('slot');
$games = $telo->games('PRAGMATIC');
$launch = $telo->launchGame('username', 'PRAGMATIC', 'vs20doghouse');
// Advanced features
$rtp = $telo->setUserRtp('PRAGMATIC', 'username', 92);
$callList = $telo->callList('PRAGMATIC', 'vs20doghouse', 'username');register(string $username)- Register a new userinfo(?string $username = null)- Get user account informationtransaction(string $username, string $type, int $amount, ?string $uniqueId = null)- Execute deposit or withdrawalresetUserBalance(?string $username)- Reset user balance to 0transferStatus(string $username, string $uniqueId)- Check transaction status
providers()- Get list of available game providersgames(string $provider)- Get list of games for a specific providerlaunchGame(string $username, string $provider, string $game, ?string $language = null, ?array $additionalParams = null)- Launch a gameturnovers(string $username, string $gameType = 'slot', ?string $startDate = null, ?string $endDate = null, int $page = 0, int $perPage = 1000)- Get game history
currentPlayers()- Get list of currently playing userscallScatterList(string $provider, string $game)- Get list of available scatter callscallScatterApply(string $username, string $provider, string $game, int $rtp, int $type)- Apply a scatter callcallHistory(int $offset = 0, int $limit = 100)- Get call historycancelCall(int $callId)- Cancel a pending call
controlUserRtp(string $username, string $provider, int $rtp)- Set RTP for specific usercontrolAllUsersRtp(int $rtp)- Set RTP for all users
createUser(string $username, ?int $depositAmount = null)- Create a new user with optional initial depositinfo(?string $username = null)- Get agent and user informationdeposit(string $username, int $amount)- Deposit funds to user accountwithdraw(string $username, ?int $amount = null)- Withdraw funds from user accountwithdrawAll()- Withdraw all users' balances
providers(string $gameType = 'slot')- Get list of game providers by type (slot or casino)games(string $provider, ?string $language = null)- Get list of games for a specific providerlaunchGame(string $username, string $provider, string $game, string $gameType = 'slot', ?string $language = null, ?int $depositAmount = null)- Launch a gamegetGameLogByDate()- Get game history by date rangegetGameLogById(int $lastHistoryId, string $gameType = 'slot', ?string $username = null)- Get game history by IDgetExchangeHistory()- Get payment transaction historygetLogDetail(string $provider, string $roundId)- Get detailed game log
currentPlayers()- Get list of currently playing userscallList(string $provider, string $game, string $username, int $callType = 1)- Get list of available callscallApply(string $provider, string $game, string $username, int $callRtp, int $callType = 1)- Apply a callcallHistory(int $offset = 0, int $limit = 100, ?int $lastCallId = null, string $orderDir = 'DESC')- Get call historycallCancel(int $callId)- Cancel a pending call
setAgentRtp(int $rtp)- Set RTP for the agentsetUserRtp(string $provider, string $username, int $rtp)- Set RTP for a specific user
The API returns responses with status codes:
status: 1- Successstatus: 0- Failure
Example error handling:
$response = $nexus->transaction('username', 'deposit', 10000);
if (!isset($response['status']) || $response['status'] !== 1) {
// Handle error
$errorMessage = $response['msg'] ?? 'Unknown error';
// Log or display error message
}The MIT License (MIT). Please see License File for more information.