softon / sms by softon

Simple SMS Gateway Package for sending short text messages from your Application. Facade for Laravel 5.Currently supported Gateways Clickatell , MVaayoo, Gupshup, SmsAchariya, SmsCountry / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.
24,859
45
6
Package Data
Maintainer Username: softon
Maintainer Contact: powerupneo@gmail.com (Shiburaj)
Package Create Date: 2015-04-17
Package Last Update: 2020-09-23
Home Page: http://softon.github.io/sms/
Language: PHP
License: MIT
Last Refreshed: 2024-04-19 15:07:51
Package Statistics
Total Downloads: 24,859
Monthly Downloads: 188
Daily Downloads: 1
Total Stars: 45
Total Watchers: 6
Total Forks: 28
Total Open Issues: 2

sms

Simple SMS Gateway Package for sending short text messages from your Application. Facade for Laravel 5(Updated to work with Laravel 5.5).Currently supported Gateways Clickatell, MVaayoo, Gupshup, SmsAchariya, SmsCountry, SmsLane, Nexmo, Mocker / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.

Installation

Usage

Edit the config/sms.php. Set the appropriate Gateway and its parameters. Then in your code... Put your blade template for the SMS in the resources/views/sms folder. Then use the below lines of code to send SMS.

use Softon\Sms\Facades\Sms;  

Send Single SMS:-

// Params: [MobileNumber,Blade View Location,SMS Params If Required]
Sms::send('9090909090','sms.test',['param1'=>'Name 1']);  

Send Multiple SMS:-

// Params: [Array of MobileNumbers,Blade View Location,SMS Params If Required]
Sms::send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1']);  

Select the Gateway before sending the Message:-

//Gateways ::  Log / Clickatell / Gupshup / MVaayoo / SmsAchariya / SmsCountry / SmsLane / Nexmo / Mocker / Custom
// Default is Log
Sms::gateway('NameOfGateway')->send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1']);  

With Response:-

// This command gives you the reply recieved from the server.
Sms::send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1'])->response();  

Custom Gateway Let us suppose you want to use any other gateway. Find the API url with which sms can be sent. For Example : http://example.com/api/sms.php?uid=737262316a&pin=YOURPIN&sender=your_sender_id&route=0&mobile=8888888888&message=How are You&pushid=1

Then you can setup the Config of Custom Gateway like this:

        '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,
         ],