shiftechafrica/net-bill-360-php-sdk
Composer 安装命令:
composer require shiftechafrica/net-bill-360-php-sdk
包简介
Library for NetBill360 Api Triggers. Use this to manage your ISP clients and network devices.
关键字:
README 文档
README
NetBill360 — Connect · Bill · Sell · Internet
🚀 What Is This?
The NetBill360 PHP SDK is a developer-friendly library that lets you interact with the NetBill360 Networking API using clean PHP code.
It's built specifically for Internet Service Providers (ISPs) and network administrators who want to automate and manage:
- Mikrotik routers
- NAS (Network Access Servers)
- PPPoE servers
- WireGuard VPN setups
Instead of manually logging in to devices or writing raw API calls, this SDK gives you simple PHP methods to handle everything in one place.
✨ Key Features
| Feature | Description |
|---|---|
| 🔌 Connect / Disconnect Users | Manage active user sessions in real-time |
| ⚙️ Bandwidth Management | Apply and enforce speed limits dynamically |
| 🧩 NAS Device Control | Manage all your NAS devices from one interface |
| 👥 Customer Management | Create, authenticate, and track user accounts |
| 🌐 WireGuard VPN | Automate VPN interface and peer configuration |
| 💾 IP Pool Management | Assign and monitor IP addresses across devices |
| 🔒 Secure API Communication | Built-in authentication and request security |
| 📊 Monitoring & Reporting | Real-time stats for users, plans, and interfaces |
| 🧠 Easy Integration | Works with Laravel or standalone PHP projects |
📘 Full Documentation: https://docs.netbill360.com
⚙️ Installation
Requirement: Composer must be installed.
Step 1 — Install the package
composer require shiftechafrica/net-bill-360-php-sdk
Step 2 — Update to the latest version (optional)
composer update shiftechafrica/net-bill-360-php-sdk --lock
Step 3 — Refresh the autoloader (if classes aren't found)
composer dump-autoload
Step 4 — Publish the config file (Laravel only) (optional)
php artisan vendor:publish --provider="NetBill360\NetBill360ServiceProvider"
This creates the file: config/netbill360.php
Step 5 — Add your API token
Open your .env file and add:
NET_BILL_360_API_TOKEN=your_api_token_here
You can find your API token in your NetBill360 dashboard.
🧩 Usage Guide
Below are practical examples organized by feature area. Each section shows how to list, create, update, fetch, and delete records.
<?php use NetBill360\NetBill360; // All SDK methods are called on a new instance of NetBill360 $sdk = new NetBill360();
🖥️ NAS Types & Devices
NAS devices are the servers that authenticate your users onto the network (e.g. Mikrotik, Cisco, Huawei).
// Get a list of all supported NAS device types. // Returns: ["MikroTik", "Cisco", "Huawei", "UBNT Access Point", ...] $sdk->getNasTypes(); // Get all NAS devices registered in your account $sdk->getAllNas(); // Add a new NAS device to your account $sdk->createNas([ "nasname" => "192.168.88.109", // IP address of the NAS device "type" => "Huawei", // Must match one of the supported types "secret" => "secret", // Shared secret used for authentication "port" => 1812, // Default RADIUS port "description" => "Main HQ NAS" // Optional human-readable label ]); // Update an existing NAS device (replace 12 with the actual device ID) $sdk->updateNas([ "type" => "VAS Experts", "secret" => "new_secret", "port" => 1812, "description" => "Updated HQ NAS" ], 12); // Fetch details of a specific NAS device by its ID $sdk->getNas(12); // Permanently remove a NAS device by its ID $sdk->deleteNas(12);
🌐 IP Pools
IP pools are groups of IP addresses that get assigned to users or devices on your network.
// List all IP pools in your account $sdk->getPools(); // Fetch details of a specific IP pool by ID $sdk->getPool(12); // Delete an IP pool by ID (use with caution — active IPs may be affected) $sdk->deletePool(12);
📡 Connection Report
Get active PPPoE connection report grouped by NAS/device
// Get active pppoe connections reports $sdk->pppoeConnectionReport();
📊 Fair Usage Policy (FUP) — Data & Time
FUP checks help you protect your network from heavy usage on lower-tier plans.
// Check how much data a specific user has consumed in a date range $sdk->getDataUsage([ "username" => "netbill360", "from_date" => "2025-10-27 00:00:00.000", // Start of the period "to_date" => "2025-10-27 23:59:59.000" // End of the period ]); // Check how much time a specific user has been connected in a date range $sdk->getTimeUsage([ "username" => "netbill360", "from_date" => "2025-10-27 00:00:00.000", "to_date" => "2025-10-27 23:59:59.000" ]);
📶 Bandwidth Plans
Plans define the download/upload speed limits and connection rules assigned to customers.
// Get all bandwidth plans $sdk->getPlans(); // Create a new bandwidth plan $sdk->createPlan([ "plan" => "700Mbps Basic", // Plan name (shown to admins/customers) "download_limit" => 700, // Download speed in Mbps "upload_limit" => 700, // Upload speed in Mbps "static_ip" => false, // Set true if this plan uses a fixed IP address "bandwidth_type" => "dedicated", // "dedicated" = full speed, "shared" = split among users "ip" => "192.0.0.1", // Required only if static_ip is true "devices" => 1 // Max devices allowed per PPPoE connection ]); // Update an existing plan by its ID $sdk->updatePlan([ "plan" => "500Mbps Shared", "download_limit" => 500, "upload_limit" => 500, "static_ip" => false, "bandwidth_type" => "shared", "ip" => "192.0.0.1", "devices" => 5 ], 29); // <-- Plan ID to update // Get details for a specific plan $sdk->getPlan(29); // Delete a plan (make sure no active customers are using it first) $sdk->deletePlan(29);
👤 Customers
Customers are individual network users. Each customer is tied to a plan and has login credentials.
// Get all customers in your account $sdk->getCustomers(); // Create a new customer account $sdk->createCustomer([ "plan_id" => 27, // The ID of the bandwidth plan to assign "username" => "netbill360", "password" => "securepassword", "service_type" => "pppoe", // "pppoe", "hotspot", or "static" "ip_address" => "", // Required only if service_type is "static" "port_limit" => 1, // Required only if service_type is "hotspot" "devices" => 1 // Max simultaneous device connections ]); // Update an existing customer's details $sdk->updateCustomer([ "plan_id" => 27, "username" => "netbill360", "password" => "newpassword", "service_type" => "pppoe", "ip_address" => "", "port_limit" => 1, "devices" => 1 ]); // Get full details for a specific customer by their username $sdk->getCustomer('netbill360'); // Check if a customer is currently online $sdk->getCustomerOnlineStatus('netbill360'); // Force-disconnect all active devices/routers for a customer $sdk->disconnectCustomerDevices('netbill360'); // Get a list of all devices currently connected for a customer $sdk->connectedCustomerDevices('netbill360'); // Permanently delete a customer account by username $sdk->deleteCustomer('netbill360');
🗓️ Subscriptions
Subscriptions link a customer to a plan for a set period. When a subscription expires, access is automatically cut off.
// List all active and past subscriptions $sdk->getSubscriptions(); // Create a new subscription for a customer (sets their access expiry date) $sdk->createSubscription([ "username" => "netbill360", "date" => "2025-11-30 23:59:59", // Access expires at the end of this date/time "timezone" => "Africa/Nairobi" // optional - Use a valid IANA timezone ]); // Update (extend or change) a customer's subscription expiry $sdk->updateSubscription([ "username" => "netbill360", "date" => "2025-12-31 23:59:59", // New expiry date "timezone" => "Africa/Nairobi" // optional - Use a valid IANA timezone ]); // Get a specific customer's subscription details $sdk->getSubscription('netbill360'); // Remove a subscription (customer will lose access) $sdk->deleteSubscription('netbill360');
🔐 WireGuard — Interfaces
WireGuard interfaces are the VPN entry points your clients connect to. Think of them as VPN servers.
// Get all WireGuard interfaces configured in your account $sdk->getWireGuardInterfaces(); // Create a new WireGuard VPN interface $sdk->createWireGuardInterface([ "name" => "Office VPN", // Friendly name for this interface "subnet_base" => "10.11.5.0", // Base IP of the VPN subnet "subnet_cidr" => 24, // Subnet mask (24 = 255.255.255.0) "listen_port" => 60000, // UDP port WireGuard listens on "enabled" => true // Whether this interface is active ]); // Update an existing WireGuard interface by its ID $sdk->updateWireGuardInterface([ "name" => "Updated Office VPN", "enabled" => true ], 12); // <-- Interface ID // Fetch details of a specific interface $sdk->getWireGuardInterface(12); // Get connection status and activity logs for a specific interface $sdk->getWireGuardInterfaceStatus(12);
🔗 WireGuard — Peers
Peers are individual client devices connected to a WireGuard interface. Each peer has a unique public key.
// Get all registered WireGuard peers $sdk->getWireGuardPeers(); // Register a new peer (client device) on a WireGuard interface $sdk->createWireGuardPeer([ "wire_guard_id" => 1, // ID of the interface this peer belongs to "name" => "John's Laptop", // Friendly label for this peer "public_key" => "8chOvnXg/Xl4jDPOmwFSVLddIs8=", // Client's WireGuard public key "assigned_ip" => "10.11.5.2", // Static IP assigned to this peer within the VPN subnet "status" => true // Whether this peer is allowed to connect ]); // Update an existing peer's configuration by its ID $sdk->updateWireGuardPeer([ "name" => "John's Work Laptop", "status" => true, "public_key" => "4iUWTridPn67tVMWLBINn/ZR0lDU6byeVZoPZA4o12I=" // New key if client rotated it ], 12); // <-- Peer ID // Get full details of a specific peer $sdk->getWireGuardPeer(12); // Get the WireGuard config file content for a peer (used to set up the client device) $sdk->getWireGuardPeerConfig(12);
🧭 Version Reference
| Version | Status | Package | Namespace | Latest Release |
|---|---|---|---|---|
| 1.x | ✅ Active | shiftechafrica/net-bill-360-php-sdk |
NetBill360\NetBill360ServiceProvider |
v1.1.7 |
🛡️ Reporting Security Issues
If you discover a security vulnerability, please report it privately to avoid exposing users to risk.
Please do not open a public GitHub issue for security-related problems.
📄 License
This package is open-source software released under the MIT License.
You are free to use, modify, and distribute it in your own projects.
shiftechafrica/net-bill-360-php-sdk 适用场景与选型建议
shiftechafrica/net-bill-360-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 46 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 10 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「mikrotik」 「technology」 「connectivity」 「nas」 「isp」 「shiftechafrica」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 shiftechafrica/net-bill-360-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shiftechafrica/net-bill-360-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 shiftechafrica/net-bill-360-php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.
jsPlumb provides a means for a developer to visually connect elements on their web pages.
Laravel Policy integration with spatie/laravel-permission
Client API for RouterOS/Mikrotik
Mikrotik API PHP Library for working with RouterOS API 2019
Client API for RouterOS/Mikrotik
统计信息
- 总下载量: 46
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 47
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-10