laravel-sms-gateway-twilio maintained by misaf
Description
Twilio SMS gateway driver for Laravel.
Author
Last update
2026/07/04 11:54
(dev-master)
License
Downloads
1
Tags
sms - twilio - laravel - sms-gateway - laravel-package - sms-api - twilio-sms - sms-provider - sms-driver
Laravel SMS Gateway Twilio Driver
Twilio SMS gateway driver for misaf/laravel-sms-gateway.
Installation
composer require misaf/laravel-sms-gateway-twilio
Laravel package discovery registers the driver service provider automatically.
Configuration
SMS_GATEWAY_DRIVER=twilio
SMS_GATEWAY_TWILIO_ACCOUNT_SID=your-account-sid
SMS_GATEWAY_TWILIO_AUTH_TOKEN=your-auth-token
// config/services.php
'twilio' => [
'account_sid' => env('SMS_GATEWAY_TWILIO_ACCOUNT_SID'),
'auth_token' => env('SMS_GATEWAY_TWILIO_AUTH_TOKEN'),
'base_url' => env('SMS_GATEWAY_TWILIO_BASE_URL'),
],
By default, the account SID is included in the base URL path. If you override base_url, include the account-specific path segment expected by Twilio.
Driver Behavior
| Option | Value |
|---|---|
| Driver name | twilio |
| Default base URL | https://api.twilio.com/2010-04-01/Accounts/{account_sid}/ |
send() endpoint |
POST Messages.json |
| Authentication | HTTP Basic auth from services.twilio.account_sid and services.twilio.auth_token |
| Payload | Form data sent directly to Twilio |
Usage
use Misaf\LaravelSmsGateway\Facade\SmsGateway;
$response = SmsGateway::driver('twilio')->send([
'To' => '+15005550006',
'From' => '+15005550001',
'Body' => 'Here is a test message.',
]);
The payload is passed directly to Twilio, so use the fields expected by the Twilio API.
Use request() when you need direct access to Laravel's HTTP client:
$request = SmsGateway::driver('twilio')->request();
Testing
composer test
composer analyse
License
MIT