Laravel SMS gateway

It is a Laravel package which will serve as gateway to send SMS through various providers. It supports multiple sms gateways, and easily extendable to support new gateways.

Installing the SMS gateway

After install follow one of these steps:

  1. Run the command php artisan vendor:publish to publish the extension. It will also copy the sms_gateway.php into the config folder of your laravel application.
  2. If the sms_gateway.php file does not exists in your application config folder, just copy the entire file and place into your config/ folder.

Then add your NEXMO_API_KEY,NEXMO_API_SECRET and NEXMO_SMS_FROM Key. To get your API Key, please visit



How to use it ?

Nexmo

Nexmo provides innovative communication SMS and Voice APIs that enable applications and enterprises to easily connect to their customers.

Website : https://www.nexmo.com/

Developer Documentation: https://developer.nexmo.com/

To send sms using Nexmo API, you need to get the API KEY and API SECRET from Nexmo.

When initially subscribing to Nexmo 2 EUR free test credit is granted for testing your application.

Configuration

Open the config file config/sms_gateway.php and add your API KEY and API SECRET to the following section of the configuration file.

Sending SMS

Use the following code to send SMS.

Twilio

Twilio allows software developers to programmatically make and receive phone calls, send and receive text messages, and perform other communication functions using its web service APIs.

Website : https://www.twilio.com/

Developer Documentation: https://www.twilio.com/docs/api

To send sms using Twilio API, you need to get the SID and TOKEN from Twilio.

When initially subscribing to Twilio $15.50 free test credit is granted for testing your application.

Configuration

Open the config file config/sms_gateway.php and add your SID and TOKEN to the following section of the configuration file.

Sending SMS

Use the following code to send SMS.

MessageBird

MessageBird is a powerful communication APIs and technical resources to help you build your communication solution.

Website : https://www.messagebird.com/en/

Developer Documentation: https://developers.messagebird.com/

To send sms using MessageBird API, you need to get the API KEY from MessageBird.

When initially subscribing to MessageBird 10 free SMS credit is granted for testing your application on live.

Configuration

Open the config file config/sms_gateway.php and add your API_KEY to the following section of the configuration file.

Sending SMS

Use the following code to send SMS.

Dialog (Sri Lanka)

Dialog Axiata PLC has hence combined its innovativeness and technical superiority to bring out a solution that will enable you to tap into this opportunity by introducing Dialog Bulk SMS Solution which will enable you to communicate by SMS to a mass list of customers/staff through an easy to use web portal that can also be accessed from any location.

Website : https://www.dialog.lk/

To send sms using Dialog SMS API, you need to get the API KEY from Dialog.

Configuration

Open the config file config/sms_gateway.php and add your API_KEY to the following section of the configuration file.

Sending SMS

Use the following code to send SMS.

Source Code – https://github.com/iyngaran/laravel-sms-gateway
Report errors – https://github.com/iyngaran/laravel-sms-gateway/issues

I hope you find this tutorial useful! 😀

1 Comment

Leave a Reply

Your email address will not be published.


*


*