Stars: 119
Forks: 40
Pull Requests: 37
Issues: 5
Watchers: 4
Last Updated: 2023-09-14 09:43:10
Xenon\LaravelBDSms is a laravel based multi sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways like sslsms, greenweb, dianahost, metronet, boomcast, bulksmsbd, adn, mobireach, tense, banglalink. You can see installation from https://youtu.be/i2wjLNoIvIo
License: MIT License
Languages: PHP
Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways for Laravel Framework. You can watch installation process from youtube.
composer require xenon/laravelbdsms
Then, publish the package
php artisan vendor:publish --provider=Xenon\LaravelBDSms\LaravelBDSmsServiceProvider
php artisan config:cache && php artisan migrate
Note: For sending message using facade you must have to set .env credentials and set default provider; Find .env credentials for different providers from inside config/sms.php)
use Xenon\LaravelBDSms\Facades\SMS; SMS::shoot('017XXYYZZAA', 'helloooooooo boss!'); SMS::shoot(['017XXYYZZAA','018XXYYZZAA'], 'helloooooooo boss!'); //for Ssl Sms Gateway Only
use LaravelBDSms, SMS; LaravelBDSms::shoot('017XXYYZZAA', 'helloooooooo boss!'); SMS::shoot('017XXYYZZAA', 'helloooooooo boss!');
use Xenon\LaravelBDSms\Facades\SMS; use Xenon\LaravelBDSms\Provider\Ssl; $response = SMS::via(Ssl::class)->shoot('017XXYYZZAA', 'helloooooooo boss!');
That should do it.
use Xenon\LaravelBDSms\Facades\SMS; use Xenon\LaravelBDSms\Provider\Ssl; SMS::shootWithQueue("01XXXXXXXXX",'test sms'); SMS::via(Ssl::class)->shootWithQueue("01XXXXXXXXX",'test sms');
That should do it.
You can generate log in database for every sms api request and save in database. For doing this. Follow below points
php artisan migrate
. This will create lbs_log
table in your databaseconfig/sms.php
'sms_log' => true,
Otherwise, if you want more control, you can use the underlying sender object. This will not touch any laravel facade or service provider.
use Xenon\LaravelBDSms\Provider\Ssl; use Xenon\LaravelBDSms\Sender; $sender = Sender::getInstance(); $sender->setProvider(Ssl::class); $sender->setMobile('017XXYYZZAA'); //$sender->setMobile(['017XXYYZZAA','018XXYYZZAA']); $sender->setMessage('helloooooooo boss!'); $sender->setQueue(true); //if you want to sent sms from queue $sender->setConfig( [ 'api_token' => 'api token goes here', 'sid' => 'text', 'csms_id' => 'sender_id' ] ); $status = $sender->send();
array:6 [▼ "status" => "response" "response" => "{"status":"FAILED","status_code":4003,"error_message":"IP Blacklisted"}" "provider" => "Xenon\LaravelBDSms\Provider\Ssl" "send_time" => "2021-07-06 08:03:23" "mobile" => "017XXYYZZAA" "message" => "helloooooooo boss!" ]
use Xenon\LaravelBDSms\Provider\MimSms; use Xenon\LaravelBDSms\Sender; $sender = Sender::getInstance(); $sender->setProvider(MimSms::class); $sender->setMobile('017XXYYZZAA'); $sender->setMessage('This is test message'); $sender->setQueue(true); //if you want to sent sms from queue $sender->setConfig( [ 'api_key' => 'api_key_goes_here', 'type' => 'text', 'senderid' => 'approved_send_id', ] ); $status = $sender->send();
Provider | Credentials Required For Sending SMS |
Status | Comment | Contact |
---|---|---|---|---|
AjuraTech | apikey, secretkey , callerID | Done | - | - |
Adn | api_key, type, senderid | Done | - | - |
Banglalink | userID, passwd , sender | Done | - | - |
BDBulkSMS | token | Done | - | - |
BoomCast | masking , userName , password | Done | - | - |
BulksmsBD | api_key,senderid | Done | - | - |
DianaHost | api_key, type, senderid | Done | - | - |
DianaSMS | ApiKey, ClientId, SenderId | Done | - | - |
Esms | api_token, sender_id | Done | - | - |
ElitBuzz | api_key, type, senderid | Done | not tested yet in live | - |
Grameenphone | username, password, messagetype | Done | not tested yet in live | - |
Infobip | user, password | Done | not tested yet in live | - |
Lpeek | acode, apiKey, requestID, masking | Done | - | - |
MDL | api_key, type, senderid | Done | not tested yet in live | - |
Metronet | api_key, mask | Done | - | - |
MimSms | api_key, type, senderid | Done | - | - |
Mobireach | Username,Password, From | Done | - | - |
NovocomBD | ApiKey , ClientId , SenderId | Done | - | - |
OnnoRokomSMS | userName, userPassword, type, maskName, campaignName | Done | not tested yet in live | - |
RedmoITSms | api_token, sender_id | Support closed | - | |
SmartLabSMS | user, password, sender | Done | - | - |
SmsinBD | api_token, senderid | Done | - | |
SmsQ | sender_id, client_id, api_key | Done | - | |
SMSNet24 | user_id, user_password, route_id(optional), sms_type_id(optional) | Done | - | |
SmsNoc | sender_id, bearer_token | Done | - | |
Sslsms | api_token, sid, csms_id | Done | - | - |
Tense | user, password, campaign, masking | Done | - | - |
TwentyFourSmsBD | apiKey, sender_id | Done | - | - |
Trubosms | api_token, sender_id | Done | - | - |
Viatech | api_key, mask | Done | - | - |
For clear documentation read this blog in Medium! and also you can download several sms providers documentations as pdf from this link!
Special thanks to
tusharkhan
tusher9352