Send Message to Bangladeshi Mobile Using Laravel
Tags: laravelsmsgateway, phpsmsgateway, laravelbdsms, laravel
Published: 2021-07-02 16:41:53

---
title: Send Message to Bangladeshi Mobile Using Laravel
published: true
description: Laravelbdsms is a package specially built for laravel to send message to Bangladeshi mobile users in easiest way.
tags: laravelsmsgateway, phpsmsgateway, laravelbdsms, laravel
//cover_image: ![Send SMS To Bangladeshi Mobile Using Laravel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0z2udpjj3q3xs9u4gaan.png)
---

LaravelBDSms is a package for sending sms/otp to Bangladeshi mobile number. This package is built specially for laravel. You view github repo from here https://github.com/arif98741/laravelbdsms ; Using this package it is possible to send message using several Bangladeshi SMS Gateways such as....

>BDBulkSMS
>BulkSMSBD
>Dianahost
>MDLSMS
>Metronet
>OnnoRokomSMS
>SSLSms

*Installation*

<pre>composer require xenon/laravelbdsms</pre>

Currently this package supports laravel 5.4*, 5.6*, 6.*, 7.* and 8.* also.

As you have installed <strong>laravelbdsms</strong>, you are now able to use this package anywhere in your project. See the below example for sending sms DianaHost Sms Gateway

### Send SMS Using Dianahost
<pre>
use Xenon\LaravelBDSms\Provider\DianaHost;
use Xenon\LaravelBDSms\Sender;


$sender = Sender::getInstance();
$sender->setProvider(DianaHost::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();

</pre>

### Send SMS Using SSL SMS

<pre>
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();
</pre>

### Simply use the facade
<pre>
use Xenon\LaravelBDSms\Facades\SMS;

SMS::shoot('017XXYYZZAA', 'helloooooooo boss!');

SMS::shoot(['017XXYYZZAA','018XXYYZZAA'], 'helloooooooo boss!');` //for Ssl Sms Gateway Only
</pre>

<pre>
use Xenon\LaravelBDSms\Facades\SMS;
use Xenon\LaravelBDSms\Provider\Ssl;

SMS::shootWithQueue("01XXXXXXXXX",'test sms');
SMS::via(Ssl::class)->shootWithQueue("01XXXXXXXXX",'test sms');
</pre>

### Or, if you want to send message with queue. This queue will be added in your jobs table. Message will be sent as soon as job is run.
<pre>
use Xenon\LaravelBDSms\Facades\SMS;
use Xenon\LaravelBDSms\Provider\Ssl;

SMS::shootWithQueue("01XXXXXXXXX",'test sms');
SMS::via(Ssl::class)->shootWithQueue("01XXXXXXXXX",'test sms'); //you can change provider using via method

</pre>

# Log Generate
<pre>
You can generate log in database for every sms api request and save in database. For doing this. Follow below points
1. Be confirm you have completed **step-2** and **step-3**
2. Run command ``php artisan migrate``. This will create ``lbs_log`` table in your database
3. Go to your project directory  and locate ``config/sms.php``
4. Find and make true 'sms_log' => true

</pre>


<i>Note: Setting configuration for sending sms is very necessary . If you don't configure instance before calling <strong>send()</strong> method </i>, you will get exception for passing using <strong>setConfig()</strong> method.


# Currently Supported SMS Gateways

| Provider        | Credentials  Required <br>    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 | -                                                           |
| Infobip         | user, password                                                    | Done           | not tested yet in live | -                                                           |
| 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           | 01777-333677                      | -                                                           |
| SmsQ            | sender_id, client_id, api_key                                            | Done           |                      | -                                                           |
| SMSNet24        | user_id, user_password, route_id(optional), sms_type_id(optional) | Done           | -                      | admin2@digitallabbd.com, +880 1705 691269, +880 1733393 712 |
| 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           | -                      | -                                                           |

If you feel bore to read documentation then you can watch youtube [video as well](https://www.youtube.com/watch?v=i2wjLNoIvIo). If you benefitted using this package you are highly requested to follow me at [Github](https://github.com/arif98741)