Official Laravel integration for Traffic Orchestrator license validation

Maintainers

Package info

github.com/traffic-orchestrator/laravel-sdk

Homepage

pkg:composer/traffic-orchestrator/laravel

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

2.0.0 2026-03-28 04:28 UTC

This package is auto-updated.

Last update: 2026-03-28 04:33:56 UTC


README

Official Laravel integration for Traffic Orchestrator.

📖 API Reference · SDK Guides · OpenAPI Spec

Install

composer require traffic-orchestrator/laravel

Configuration

php artisan vendor:publish --provider="TrafficOrchestrator\Laravel\ServiceProvider"

Set in .env:

TO_API_KEY=sk_live_xxxxx

Service Provider + Facade

// Auto-registered via package discovery. Use the facade:
use TrafficOrchestrator\Laravel\Facades\TO;

$result = TO::validateLicense($token, $domain);

Facade Methods

Method Auth Description
TO::validateLicense($token, $domain) No Validate a license key
TO::verifyOffline($token) No Ed25519 offline verification
TO::listLicenses() Yes List all licenses
TO::createLicense($options) Yes Create a new license
TO::rotateLicense($id) Yes Rotate license key
TO::deleteLicense($id) Yes Revoke a license
TO::addDomain($id, $domain) Yes Add domain to license
TO::removeDomain($id, $domain) Yes Remove domain from license
TO::getUsage() Yes Get usage statistics
TO::healthCheck() No Check API health

Middleware

// routes/web.php
Route::middleware('license:pro')->group(function () {
    Route::get('/premium', [PremiumController::class, 'index']);
});

Register in app/Http/Kernel.php:

'license' => \TrafficOrchestrator\Laravel\Middleware\VerifyLicense::class,

Multi-Environment

# .env (Production)
TO_API_KEY=sk_live_xxxxx

# .env.staging
TO_API_KEY=sk_test_xxxxx
TO_API_URL=https://api-staging.trafficorchestrator.com/api/v1

Offline Verification (Enterprise)

Validate licenses locally without API calls using Ed25519 JWT signatures:

// Add TO_PUBLIC_KEY to your .env
$result = TO::verifyOffline($licenseToken);
if ($result->valid) {
    echo "Plan: " . $result->planId;
}

Requirements

  • PHP 8.0+
  • Laravel 9+

License

MIT