nextsms/php-client
Composer 安装命令:
composer require nextsms/php-client
包简介
Nextsms for PHP
README 文档
README
The Nextsms for PHP makes it easy for developers to access Nextsms services in their PHP code, and build robust applications and software using services like Bulk SMS delivery, Sub customers, and more.
V2: You are currently viewing the documentation for the NextSMS PHP SDK V2. If you are looking for the documentation for the V1 SDK, you can find it here.
Installation
Requirement: PHP 8.0 or higher is required.
You can install the package via Composer:
composer require nextsms/php-client
Usage
require 'vendor/autoload.php'; use Nextsms\Nextsms; $client = Nextsms::create( username: 'YOUR_USERNAME', password: 'YOUR_PASSWORD', from: 'NEXTSMS' ); $helloMessage = $client->messages()->send([ "to": '2557123456789', "text": 'Hello World', // from is optional if you have set it in the constructor ]); // Or $message = Message::create(text: 'Hello World',to: '2557123456789'); $helloMessage = $client->messages()->send($message); // Send Later $messageScheduled = $client->messages()->sendLater( new Message(to: '2557123456789', text: 'Hello World'), \DateTime::createFromFormat('Y-m-d', '2020-12-31') ); // Send to many $manyMessages = $client->messages()->sendMany( MessageCollection::create([ Message::text(to: '2557123456789', text: 'Hello World'), Message::text(to: '2557123456789', text: 'Hello World'), ]) ); // Or $manyMessages = $client->messages()->sendMany( MessageCollection::create([ Message::text(to: '2557123456789', text: 'Hello World'), Message::text(to: [ '2557123456789', '2557123456789' ], text: 'Hello World'), ]); ); // Delivery reports $allReports = $client->reports()->all(); // Query $reports = $client->reports() ->query() // Using date string ->sentFrom(date: '01-01-2022') // Or using date object ->sentUntil(date: \DateTime::create('now')) ->get(); $report = $client->reports()->get($messageId); // // Customer $customer = Customer::create([ "first_name" => "Api", "last_name" => "Customer", "username" => "api_customer", "email" => "apicust@customer.com", "phone_number" => "0738234339", "account_type" => "Sub Customer (Reseller)", "sms_price" => 200 ]); // Create $customer = $client->customers()->create($customer); // Recharge $recharge = $client->customers()->recharge($customer, 1000); // Deduct $deduct = $client->customers()->deduct($customer, 1100);
Testing
Using Pest framework.
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Star this repository
If you enjoy this package, please star this repository to encourage further development.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
nextsms/php-client 适用场景与选型建议
nextsms/php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.14k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2021 年 05 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「bulk sms」 「nextsms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nextsms/php-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nextsms/php-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nextsms/php-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP behavior plugin for easily generating some complicated queries like (bulk) insert/upsert etc.
A PSR-7 compatible library for making CRUD API endpoints
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
PHP SDK for Mobile Message SMS API
Extensible library for building notifications and sending them via different delivery channels.
Bulk edit
统计信息
- 总下载量: 1.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 7
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-10