PHP code example of traffic-orchestrator / laravel

1. Go to this page and download the library: Download traffic-orchestrator/laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

traffic-orchestrator / laravel example snippets


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

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

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

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

// Add TO_PUBLIC_KEY to your .env
$result = TO::verifyOffline($licenseToken);
if ($result->valid) {
    echo "Plan: " . $result->planId;
}
bash
php artisan vendor:publish --provider="TrafficOrchestrator\Laravel\ServiceProvider"

TO_API_KEY=sk_live_xxxxx