laravel-sms-gateway-sunway maintained by misaf
Description
Sunway SMS gateway driver for Laravel.
Author
Last update
2026/07/04 11:54
(dev-master)
License
Downloads
0
Tags
sms - laravel - sms-gateway - laravel-package - sms-api - sms-provider - sunway - sms-driver - sunway-sms
Laravel SMS Gateway Sunway Driver
Sunway driver package for misaf/laravel-sms-gateway.
This package registers the sunway driver. The core package provides the manager, facade, driver contract, shared configuration file, and SmsSent event.
Requirements
- PHP 8.2+
- Laravel 10, 11, 12, or 13
misaf/laravel-sms-gateway
Installation
composer require misaf/laravel-sms-gateway-sunway
Laravel package discovery registers the driver service provider automatically.
Configuration
Publish the core configuration file if it has not already been published:
php artisan vendor:publish --tag=sms-gateway-config
Set the default driver and Sunway credentials in .env:
SMS_GATEWAY_DRIVER=sunway
SMS_GATEWAY_SUNWAY_GATEWAY=https://sms.sunwaysms.com/smsws/HttpService.ashx
SMS_GATEWAY_SUNWAY_USERNAME=your-username
SMS_GATEWAY_SUNWAY_PASSWORD=your-password
SMS_GATEWAY_SUNWAY_SPECIALNUMBER=3000xxxx
SMS_GATEWAY_SUNWAY_TIMEOUT=10
SMS_GATEWAY_SUNWAY_CONNECT_TIMEOUT=5
The driver reads from the sunway key in config/sms_gateway.php:
'sunway' => [
'gateway' => env('SMS_GATEWAY_SUNWAY_GATEWAY', 'https://sms.sunwaysms.com/smsws/HttpService.ashx'),
'username' => env('SMS_GATEWAY_SUNWAY_USERNAME', ''),
'password' => env('SMS_GATEWAY_SUNWAY_PASSWORD', ''),
'special_number' => env('SMS_GATEWAY_SUNWAY_SPECIALNUMBER'),
'timeout' => (int) env('SMS_GATEWAY_SUNWAY_TIMEOUT', env('SMS_GATEWAY_TIMEOUT', 10)),
'connect_timeout' => (int) env('SMS_GATEWAY_SUNWAY_CONNECT_TIMEOUT', env('SMS_GATEWAY_CONNECT_TIMEOUT', 5)),
],
Usage
use Misaf\LaravelSmsGateway\Facade\SmsGateway;
SmsGateway::driver('sunway')->send()->get('', [
'method' => 'SendSMS',
'mobile' => '09123456789',
'message' => 'Hello',
]);
Sunway requests are sent to the configured gateway with UserName and Password query parameters added automatically.
Events
After a request receives a response, the core package dispatches Misaf\LaravelSmsGateway\Events\SmsSent with the driver name, request, and response.
Testing
composer test
License
MIT