shaz3e/twilio
最新稳定版本:v1.1.0
Composer 安装命令:
composer require shaz3e/twilio
包简介
Send SMS with Twilio in your Laravel Application
README 文档
README
Introduction
This is a Laravel package for sending SMS with Twilio
Installation
You can install the package via composer by running the following command in your terminal
composer require shaz3e/twilio
Publishing Configurations
Publish config only
php artisan vendor:publish --tag=twilio-config
This is the content of the config file that will be published at config/twilio.php
<?php
return [
'twilio_sid' => env('TWILIO_ACCOUNT_SID'),
'twilio_token' => env('TWILIO_AUTH_TOKEN'),
'twilio_from' => env('TWILIO_SMS_FROM'),
];
Update .env file
Next, edit your .env file with your Twilio Credentials TWILIO_ACCOUNT_SID=xxxxx TWILIO_AUTH_TOKEN=xxxxx TWILIO_SMS_FROM=+xxxxx
Usage
To send a SMS message, you can use the notify() method available on the Twilio Facade
<?php
use Shaz3e\Twilio\Facades\Twilio;
$sendSms = Twilio::notify('+123456789', 'Hello')
return $sendSms;
To send WhatsAp message you can use the notifyWhatsApp method available on the Twilio Facade
<?php
use Shaz3e\Twilio\Facades\Twilio;
$sendWhatsApp = Twilio::notifyWhatsApp('+123456789', 'Hello')
return $sendWhatsApp;
Contributing
- If you have any suggestions please let me know : https://github.com/Shaz3e/twilio/pulls.
- Please help me improve code https://github.com/Shaz3e/twilio/pulls
License
Twilio is licensed under the MIT license. Enjoy!
Credit
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-15