programmerhasan/twilio-whatsapp
最新稳定版本:v1.3.0
Composer 安装命令:
composer require programmerhasan/twilio-whatsapp
包简介
A Laravel package to send WhatsApp messages and OTPs via Twilio.
关键字:
README 文档
README
A Laravel package to send WhatsApp OTPs and SMS messages using Twilio.
Supports:
- WhatsApp messages & OTPs
- SMS messages
Requirements
- PHP >= 8.0
- Laravel >= 9.x
- Twilio SDK (included via composer)
Twilio Setup
1. Create a WhatsApp Service
- Go to Twilio WhatsApp Services
- Create a new WhatsApp Service
- Note down your Service SID
2. Content Template
- Go to Twilio Content Template Builder
- Create your template for OTP or messages
- Copy the Content SID
- For OTP - use default Verification Content SID
3. WhatsApp Sender
- Go to WhatsApp Senders
- Register your WhatsApp number
- Use the number in your config as
whatsapp_from(without thewhatsapp:prefix)
Installation
composer require programmerhasan/twilio-whatsapp
Publishing config file
php artisan vendor:publish --provider="ProgrammerHasan\TwilioWhatsApp\TwilioWhatsAppServiceProvider" --tag=config
Add your .env values:
TWILIO_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_CONTENT_SID=your_whatsapp_content_sid
TWILIO_WHATSAPP_FROM=+1415XXXXXXX
Usage
WhatsApp OTP
use TwilioWhatsApp;
$otp = TwilioWhatsApp::sendOtp('+88017XXXXXXXX');
Send WhatsApp Message
use TwilioWhatsApp;
TwilioWhatsApp::sendMessage('+88017XXXXXXXX', 'Hello from Twilio WhatsApp!');
Support: programmerhasan.s@gmail.com or +8801975568604
License
This repository is licensed under the MIT License.
Copyright 2025 ProgrammerHasan.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-14