masrur447/twilio-sdk
Composer 安装命令:
composer require masrur447/twilio-sdk
包简介
Laravel integration for Twilio SDK
README 文档
README
A simple Laravel package that provides an elegant wrapper for sending SMS using the Twilio API.
Developed by Masrur
🚀 Features
- Easy Twilio integration in Laravel
- Simple API to send SMS
- Configuration via
.envfile
🧱 Requirements
- PHP 8.2 or higher
- Laravel 12x
- Twilio Account & Credentials
📦 Installation
Install the package via Composer:
composer require masrur447/twilio-sdk
⚙️ Configuration
Step 1: Publish the config file
php artisan vendor:publish --tag=twilio-config
This will publish the config file to:
config/twilio.php
Step 2: Add your credentials in .env
TWILIO_SID=your_twilio_account_sid TWILIO_TOKEN=your_twilio_auth_token TWILIO_SENDER_NUMBER=your_twilio_whatsapp_sender_number TWILIO_SMS_NUMBER=your_twilio_sms_sender_number
Step 3: Example of config/twilio-sdk.php
return [ 'account_sid' => env('TWILIO_SID', ''), 'auth_token' => env('TWILIO_TOKEN', ''), 'wp_sender' => env('TWILIO_SENDER_NUMBER', ''), 'sms_sender' => env('TWILIO_SMS_NUMBER', ''), ];
📤 Usage
✅ Send Whatsapp Message
use Masrur447\TwilioSdk\Twilio; Twilio::sendWP('+8801234567890', 'Hello from Laravel Twilio SDK!', 'media url or null');
✅ Send SMS
use Masrur447\TwilioSdk\Twilio; Twilio::sendSMS('+8801234567890', 'Hello from Laravel Twilio SDK!');
🧪 Easy way to use it just add trait in user model
use InteractsWithTwilio; $user = User::find(1); $user->notifyTwilioWhatsapp('Hellow from Laravel trait Twilio SDK', 'media url or null'); $user->notifyTwilioSMS('Hellow from Laravel trait Twilio SDK');
🧪 Example: Sending SMS from Controller
namespace App\Http\Controllers; use Illuminate\Http\Request; use Masrur447\TwilioSdk\Twilio; class SmsController extends Controller { public function send(Request $request) { Twilio::sendSMS($request->phone, $request->message); return response()->json([ 'status' => 'SMS sent successfully!', ]); } }
🧪 Example: Tinker Usage
php artisan tinker >>> Twilio::sendSMS('+8801234567890', 'Test SMS from tinker');
🛠 Advanced Usage (Optional)
Coming soon...
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check issues page if you want to contribute.
🧾 License
This project is open-sourced under the MIT license.
See the LICENSE file for more information.
🙌 Author
Masrur — GitHub
🌟 Show your support
If you like this package, give it a ⭐ on the GitHub repo!
masrur447/twilio-sdk 适用场景与选型建议
masrur447/twilio-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 53 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 07 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「sdk」 「twilio」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 masrur447/twilio-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 masrur447/twilio-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 masrur447/twilio-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Componente para integração com serviços de mensageria com APIs externas como Twilio, SendGrid, AWS SES, etc.
Extensible library for building notifications and sending them via different delivery channels.
yii2-sms expand
A Twilio SMS plugin for Yii2 based off my base package, Yii2 SMS, to make sending SMS messages as easy as emails!
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-27