pooshgan/pasarguard-php
Composer 安装命令:
composer require pooshgan/pasarguard-php
包简介
Production-ready PHP SDK for the PasarGuard API
README 文档
README
A production-ready, strongly-typed PHP library for interacting with the PasarGuard Panel API.
Installation
composer require pooshgan/pasarguard-php
Usage
<?php require 'vendor/autoload.php'; use Pooshgan\PasarGuard\Client; use Pooshgan\PasarGuard\PasarGuard; // Initialize the client with your panel URL and Admin Token $client = new Client('https://your-panel-domain.com', 'your-admin-token'); $api = new PasarGuard($client); // Get all users $users = $api->users->list(); // Create a new user $newUser = $api->users->create([ 'username' => 'test_user', 'status' => 'active', 'data_limit' => 1073741824 ]); // Get specific user by username $user = $api->users->getByUsername('test_user');
Features
- Strongly Typed: All API endpoints are mapped to explicit methods with correct path parameters.
- Guzzle Powered: Uses GuzzleHTTP for reliable, production-grade HTTP requests.
- Complete Coverage: Covers 100% of the PasarGuard API surface (Users, Nodes, Cores, Admins, Settings, etc.).
- Flexible Auth: Supports Bearer Token auth and custom headers (e.g., for Telegram MiniApp auth).
Endpoints
All endpoints are accessible via the main PasarGuard class:
$api->adminRoles$api->users$api->hosts$api->groups$api->hwids$api->setup$api->system$api->cores$api->nodes$api->subscriptions$api->userTemplates$api->admins$api->settings$api->clientTemplates$api->home
Credits
- Original Panel: PasarGuard
- SDK Author: pooshgan
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-22