sms
Simple SMS Gateway Package for sending short text messages from your Application. Facade for Laravel 5.Currently supported Gateways Clickatell, MVaayoo, Gupshup, SmsAchariya, SmsCountry, SmsLane / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.
Installation
- Edit the composer.json add to the require array & run composer update
"softon/sms": "dev-master"
composer update
- Add the service provider to the config/app.php file in Laravel
'Softon\Sms\SmsServiceProvider',
- Add an alias for the Facade to the config/app.php file in Laravel
'Sms' => 'Softon\Sms\Facades\Sms',
- Publish the config & views by running
php artisan vendor:publish
Usage
Edit the config/sms.php. Set the appropriate Gateway and its parameters. Then in your code...
use Softon\Sms\Facades\Sms;
Send Single SMS:-
Sms::send('9090909090','sms.test',['param1'=>'Name 1']);
Send Multiple SMS:-
Sms::send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1']);
With Response:-
Sms::send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1'])->response();
Custom Gateway
Config of Custom Gateway :
'custom' => [
'url' => 'http://example.com/api/sms.php?',
'params' => [
'send_to_name' => 'mobile',
'msg_name' => 'message',
'others' => [
'uid' => '737262316a',
'pin' => 'YOURPIN',
'sender' => 'your_sender_id',
'route' => '0',
'pushid' => '1',
],
],
'add_code' => true,
],