Description
Skip to content
Product
Solutions
Open Source
Pricing
Search or jump to…
Sign in
Sign up
iyngaran
/
laravel-sms-gateway
Public
Code
Issues
Pull requests
Actions
Projects
Security
Insights
iyngaran/laravel-sms-gateway
Folders and files
Name
Latest commit
author
Iyathurai Iyngaran
Merge branch ‘dev-master’
5a6edd2
·
5 years ago
History
src
Added Dialog (Sri Lanka) SMS Gateway
5 years ago
test
Removed unused variables
5 years ago
LICENSE
Added the NexmoSmsGateway and TwilioSmsGateway
5 years ago
README.md
Document Updated
5 years ago
composer.json
Version Updated
5 years ago
Repository files navigation
README
MIT license
Laravel SMS gateway
Latest Stable Version Total Downloads Latest Unstable Version License
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
composer require iyngaran/sms-gateway
After install follow one of these steps:
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.
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
// config/sms_gateway.php
return [
‘nexmo_sms_api_settings’ => [
‘API_KEY’ => env(‘NEXMO_API_KEY’, ”),
‘API_SECRET’ => env(‘NEXMO_API_SECRET’, ”),
‘SEND_SMS_FROM’ => env(‘NEXMO_SMS_FROM’, ‘IYNGARAN’),
],
‘twilio_sms_api_settings’ => [
‘SID’ => env(‘TWILIO_SID’, ”),
‘TOKEN’ => env(‘TWILIO_TOKEN’, ”),
‘SEND_SMS_FROM’ => env(‘TWILIO_SMS_FROM’, ‘+12012926824’),
],
‘message_bird_sms_api_settings’ => [
‘API_KEY’ => env(‘MESSAGE_BIRD_API_KEY’, ”),
‘SEND_SMS_FROM’ => env(‘MESSAGE_BIRD_SMS_FROM’, ‘+12012926824’),
],
‘dialog_sms_api_settings’ => [
‘API_KEY’ => env(‘DIALOG_SMS_API_KEY’, ”),
‘ENDPOINT’ => env(‘DIALOG_SMS_ENDPOINT’, ”),
‘SEND_SMS_FROM’ => env(‘DIALOG_SMS_FROM’, ‘IYNGARAN’),
],
];
USAGE
Nexmo
Nexmo
Nexmo provides innovative communication SMS and Voice APIs that enable applications and enterprises to easily connect to their customers.
Website : www.nexmo.com
Developer Documentation: 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.
Nexmo 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.
‘nexmo_sms_api_settings’ => [
‘API_KEY’ => env(‘NEXMO_API_KEY’, ”),
‘API_SECRET’ => env(‘NEXMO_API_SECRET’, ”),
‘SEND_SMS_FROM’ => env(‘NEXMO_SMS_FROM’, ‘IYNGARAN’),
],
Sending SMS – Nexmo
Use the following code to send SMS.
$objSMS = new SmsGateway(new NexmoSmsGateway());
$response = $objSMS->sendSms(‘+12012926822′,’Hello Nexmo’);
Twilio
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 : twilio.com
Developer Documentation: Twilio 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.
Twilio Configuration
Open the config file config/sms_gateway.php and add your SID and TOKEN to the following section of the configuration file.
twilio_sms_api_settings’ => [
‘SID’ => env(‘TWILIO_SID’, ”),
‘TOKEN’ => env(‘TWILIO_TOKEN’, ”),
‘SEND_SMS_FROM’ => env(‘TWILIO_SMS_FROM’, ‘+12012926824’),
]
Sending SMS – Twilio
Use the following code to send SMS.
$objSMST = new SmsGateway(new TwilioSmsGateway());
$response = $objSMST->sendSms(‘+12012926822′,’Hello Twilio’);
Dialog (Sri Lanka)
MessageBird
MessageBird is a powerful communication APIs and technical resources to help you build your communication solution.
Website : messagebird.com
Developer Documentation: 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.
MessageBird Configuration
Open the config file config/sms_gateway.php and add your API_KEY to the following section of the configuration file.
‘message_bird_sms_api_settings’ => [
‘API_KEY’ => env(‘MESSAGE_BIRD_API_KEY’, ”),
‘SEND_SMS_FROM’ => env(‘MESSAGE_BIRD_SMS_FROM’, ‘+12012926824’),
]
Sending SMS – MessageBird
Use the following code to send SMS.
$objSMST = new SmsGateway(new MessageBirdSmsGateway());
$response = $objSMST->sendSms(‘+12012926822′,’Hello MessageBird’);
Dialog (Sri Lanka)
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 : dialog.lk
To send sms using Dialog SMS API, you need to get the API KEY from Dialog.
Dialog Configuration
Open the config file config/sms_gateway.php and add your API_KEY to the following section of the configuration file.
‘dialog_sms_api_settings’ => [
‘API_KEY’ => env(‘DIALOG_SMS_API_KEY’, ”),
‘ENDPOINT’ => env(‘DIALOG_SMS_ENDPOINT’, ”),
‘SEND_SMS_FROM’ => env(‘DIALOG_SMS_FROM’, ‘IYNGARAN’),
]
Sending SMS – Dialog
Use the following code to send SMS.
$objSMS = new SmsGateway(new DialogSmsGateway());
$response = $objSMS->sendSms(‘+12012926822′,’Hello, from Dialog SMS’);
CONTRIBUTING
You can contribute with this module suggesting improvements, making tests and reporting bugs. Use issues for that.
ERRORS
Report errors opening Issues.
About
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.
blog.iyngaran.info/laravel-sms-gateway
Topics
php laravel twilio nexmo messagebird sms-gateway laravel-sms-gateway dialog-sms
Resources
Readme
License
MIT license
Activity
Stars
10 stars
Watchers
1 watching
Forks
4 forks
Report repository
Releases
8 tags
Packages
No packages published
Languages
PHP
100.0%
Footer
© 2024 https://speedsms.in/, Inc.
Footer navigation
Terms
Privacy
Security
Status
Docs
Contact
Manage cookies
Do not share my personal information