2017 © Pedro Peláez
 

library 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 , Nexmo, Mocker / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.

image

xilwal/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 , Nexmo, Mocker / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.

  • Friday, July 13, 2018
  • by xilwal
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

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 Sparrow, 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., (*1)

Installation, (*2)

     composer require xilwal/sms
  1. Or Edit the composer.json add to the require array & run composer update
     "xilwal/sms": "dev-master" 
     composer update 
  2. (Optional for Laravel 5.5) Add the service provider to the config/app.php file in Laravel
     Xilwal\Sms\SmsServiceProvider::class, 
  3. (Optional for Laravel 5.5) Add an alias for the Facade to the config/app.php file in Laravel
     'Sms' => Xilwal\Sms\Facades\Sms::class, 
  4. Publish the config & views by running
     php artisan vendor:publish 

Usage, (*3)

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., (*4)

use Xilwal\Sms\Facades\Sms;  
 ```
Send Single SMS:-
```php
// Params: [MobileNumber,Blade View Location,SMS Params If Required]
Sms::send('9090909090','sms.test',['param1'=>'Name 1']);  
 ```
Send Multiple SMS:-
```php
// 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:-
```php
//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:-, (*5)

// 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, (*6)

Then you can setup the Config of Custom Gateway like this:, (*7)

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

The Versions

13/07 2018

dev-master

9999999-dev

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 , Nexmo, Mocker / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.

  Sources   Download

MIT

The Requires

 

by Bikash Silwal

nexmo clickatell sms gateway custom sms mocker gupshup mvaayoo smsachariya smscountry smslane sparrow itexmo