kgoofori/widepay-sms-notification
Composer 安装命令:
composer require kgoofori/widepay-sms-notification
包简介
This package makes it easy to send SMS notifications using Widepaycash SMS API the laravel way
README 文档
README
This package makes it easy to send SMS notifications using Widepaycash SMS API the laravel way
Contents
Installation
Install this package with Composer:
composer require kgoofori/widepay-sms-notification
Setting up the FCM service
You need to register for a API id and key from Widepaycash for your application from here: https://widepaycash.com/
Once you've registered and generated ypu API id and key, add the API id and key to your configuration in config/broadcasting.php
'connections' => [ .... 'widepay_sms' => [ 'id' => env('WIDEPAY_ID', ''), 'key' => env('WIDEPAY_KEY', ''), ] ... ]
Usage
You can now send SMS notifications via Widepay API by creating a WidepaySmsMessage:
... use NotificationChannels\WidepaySms\WidepaySmsChannel; use NotificationChannels\WidepaySms\WidepaySmsMessage; class UserActivated extends Notification { public function via($notifiable) { return [WidepaySmsChannel::class]; } public function toWidepaySms($notifiable) { return (new WidepaySmsMessage) ->sender('WidepaySms') ->message('Testing message') ->recipient('23324XXXXXXX'); //optional if routeNotificationForWidepaySms() is set on notifiable model } }
You may have to set a routeNotificationForWidepaySms() method in your notifiable model. For example:
class User extends Authenticatable { use Notifiable; .... /** * Specifies the user's phone * * @return string */ public function routeNotificationForWidepaySms() { return $this->phone; } }
Once you have that in place, you can simply send a notification to the user via
$user->notify(new AccountActivated);
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email kgoofori@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 428
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-22