axelhub/twilio
最新稳定版本:1.0
Composer 安装命令:
composer require axelhub/twilio
包简介
Axel's sms send package
README 文档
README
Twilio sms sender
Installation
composer require axelhub/twilio
After installing run command below. It will create twilio.php file in config folder.
php artisan twilio:install
Configure twilio.php file with Twilio key, secret, sid and from by adding variables below to your .env file:
TWILIO_APP_KEY= TWILIO_APP_SECRET= TWILIO_APP_SID= TWILIO_APP_FROM=
Also, in the twilio.php file you can customize the list of countries where the app will be able to send messages.
List of countries.
Using
Custom using
$twilio = new Twilio(); $twilio->sendSms($PhoneNumber, $Message);
Using with Laravel notification
More about laravel notifications.
Add SmsChannel::class class into via function in notification:
use Axel\Twilio\SmsChannel; public function via($notifiable) { return [SmsChannel::class]; }
Create toSms() function in notification class:
use Axel\Twilio\SmsMessage; public function toSms($notifiable): SmsMessage { return (new SmsMessage) ->to($PhoneNumber) ->message($Message); }
统计信息
- 总下载量: 65
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-12