定制 traffic-orchestrator/laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

traffic-orchestrator/laravel

最新稳定版本:2.0.0

Composer 安装命令:

composer require traffic-orchestrator/laravel

包简介

Official Laravel integration for Traffic Orchestrator license validation

README 文档

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固