nasution/zenziva-sms
最新稳定版本:1.5.0
Composer 安装命令:
composer require nasution/zenziva-sms
包简介
Zenziva - Indonesia Online SMS Gateway
README 文档
README
Zenziva SMS client. Read their docs for more information.
Installation
Run composer
composer require nasution/zenziva-sms
Usage
Standalone usage
Make sure you already have Zenziva account.
require 'vendor/autoload.php'; use Nasution\ZenzivaSms\Client as Sms; $sms = new Sms('userkey', 'passkey'); // Simple usage $sms->send('08123456789', 'Halo apa kabar?'); // Alternative way $sms->to('08123456789') ->text('Halo apa kabar?') ->send(); // SMS masking $sms->masking()->send('08123456789', 'Halo apa kabar?'); // For OTP $sms->masking()->otp()->send('08123456789', 'This is OTP code'); // With custom sub-domain (if you choose paid for "SMS Center" plan) $sms->subdomain('hello') ->to('08123456789') ->text('Halo apa kabar?') ->send(); // Change default URL $sms->url('https://reguler.zenziva.co.id/apps/smsapi.php') ->to('08123456789') ->text('Halo') ->send();
Use with Laravel Notification
Starts from Laravel 5.3, you can use Laravel Notification feature. You need to register the service provider. Open config/app.php, add this line inside providers.
Nasution\ZenzivaSms\NotificationServiceProvider::class,
Note: If you use Laravel 5.5 or higher, you can skip register service provider manually.
Insert this inside your config/services.php,
'zenziva' => [ 'userkey' => 'your-userkey', 'passkey' => 'your-password', 'subdomain' => '', 'masking' => false, 'scheme' => 'https', ],
Add this method to your User model (or any notifiable model),
public function routeNotificationForZenzivaSms() { return $this->phone_number; // Depends on your users table field. }
On your Notification class, add this inside via method. Like so
use Nasution\ZenzivaSms\NotificationChannel as ZenzivaSms; // ... public function via($notifiable) { return [ZenzivaSms::class]; }
Now, we are ready to use notification feature in Laravel 5.3
use App\User; use App\Notifications\PingNotification; Route::get('/', function () { // Send notification to all users $users = User::all(); \Notification::send($users, new PingNotification); // Or just to one user User::find(1)->notify(new PingNotification); });
License
MIT © Mulia Arifandi Nasution
nasution/zenziva-sms 适用场景与选型建议
nasution/zenziva-sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.85k 次下载、GitHub Stars 达 32, 最近一次更新时间为 2016 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「laravel」 「zenziva」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nasution/zenziva-sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nasution/zenziva-sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nasution/zenziva-sms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Unofficial Zenziva client api
Zenziva SMS notifications driver.
Zenziva integration for Laravel
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
yii2-sms expand
统计信息
- 总下载量: 17.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 32
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-04