coreproc/laravel-notification-channel-globe-labs-sms
Composer 安装命令:
composer require coreproc/laravel-notification-channel-globe-labs-sms
包简介
This package makes it easy to send notifications using Globe Labs SMS with Laravel 5.3, 5.4, and 5.5
README 文档
README
This package makes it easy to send notifications using Globe Labs SMS with Laravel 5.3 and above.
Contents
Installation
Install this package with Composer:
composer require coreproc/laravel-notification-channel-globe-labs-sms
Register the ServiceProvider in your config/app.php (Skip this step if you are using Laravel 5.5 and above):
Coreproc\GlobeLabsSms\GlobeLabsSmsServiceProvider::class,
Setting up the Globe Labs Sms service
Start by creating a project here: http://www.globelabs.com.ph/#!/developer/api/sms
Please note that this package does not handle the opt-in steps required for a user to subscribe to your Globe Labs SMS application.
This package assumes that you have the opt-in steps handled either via SMS or through a web form and that you already have access to the subscriber's access token.
Once you've registered and set up your app, add the short code to your configuration in config/broadcasting.php
'connections' => [ .... 'globe_labs_sms' => [ 'short_code' => env('GLOBE_LABS_SMS_SHORT_CODE'), ], ... ]
Usage
Set a routeNotificationForGlobeLabsSms() method in your model/class with the Notifiable trait. For example:
class User extends Model { use Notifiable; public function routeNotificationForGlobeLabsSms() { return [ 'access_token' => 'access-token-obtained-from-sms-opt-in-this-could-be-stored-in-your-database', 'address' => '09171234567', // can be any format as long as it is a valid mobile number ]; } }
You can now send SMS via Globe Labs by creating an GlobeLabsSmsMessage in a Notification class:
class AccountActivated extends Notification { public function via($notifiable) { return [GlobeLabsSmsChannel::class]; } public function toGlobeLabsSms($notifiable) { return GlobeLabsSmsMessage::create($notifiable) ->setMessage('This is a test message'); } }
Call the SMS notification by calling the notify() method in the model/class. For example:
$user = User::find(1); $user->notify(new AccountActivated);
Security
If you discover any security related issues, please email chris.bautista@coreproc.ph instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
coreproc/laravel-notification-channel-globe-labs-sms 适用场景与选型建议
coreproc/laravel-notification-channel-globe-labs-sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 231 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 05 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 coreproc/laravel-notification-channel-globe-labs-sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 coreproc/laravel-notification-channel-globe-labs-sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 231
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-05