onix-solutions/sms-telera
Composer 安装命令:
composer require onix-solutions/sms-telera
包简介
SmsTelera Notifications channel for Laravel 5.3+.
README 文档
README
This package makes it easy to send notifications using sms.telera with Laravel 5.3+.
Contents
Installation
You can install the package via composer:
composer require onix-solutions/sms-telera
Then you must install the service provider:
// config/app.php 'providers' => [ ... OnixSolutions\SmsTelera\SmsTeleraServiceProvider::class, ],
Setting up the SmsTelera service
Add your SmsTelera login, secret key (hashed password) and default sender name (or phone number) to your config/services.php:
// config/services.php ... 'smsctelera' => [ 'tk' => env('SMSCTELERA_TK'), 'sender' => env('SMSCTELERA_SENDER') ], ...
If you want use other host than
smsc.telera, you MUST set custom host WITH trailing slash.
// .env
...
SMSCTELERA_HOST=http://www1.smsc.kz/
...
// config/services.php ... 'smsctelera' => [ ... 'host' => env('SMSCTELERA_HOST'), ... ], ...
Usage
You can use the channel in your via() method inside the notification:
use Illuminate\Notifications\Notification; use OnixSolutions\SmsTelera\SmsTeleraMessage; use OnixSolutions\SmsTelera\SmsTeleraChannel; class AccountApproved extends Notification { public function via($notifiable) { return [SmsTeleraChannel::class]; } public function toSmsTelera($notifiable) { return SmsTeleraMessage::create("Task #{$notifiable->id} is complete!"); } }
In your notifiable model, make sure to include a routeNotificationForSmsctelera() method, which returns a phone number
or an array of phone numbers.
public function routeNotificationForSmsctelera() { return $this->phone; }
Available methods
from(): Sets the sender's name or phone number.
content(): Set a content of the notification message.
sendAt(): Set a time for scheduling the notification message.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email jhaoda@gmail.com 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.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-24