Skip to content

Latest commit

 

History

History
97 lines (81 loc) · 2.39 KB

readme.md

File metadata and controls

97 lines (81 loc) · 2.39 KB

Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways for Laravel. You should use composer 2 for latest updates of this package.

Installation

step

composer require xenon/laravelbdsms

Sample Code DianaHost

use Xenon\LaravelBDSms\Provider\DianaHost;
use Xenon\LaravelBDSms\Sender;


$sender = Sender::getInstance();
$sender->setProvider(DianaHost::class); 
$sender->setMobile('017XXYYZZAA');
$sender->setMessage('helloooooooo boss!');
$sender->setConfig(
   [
       'api_key' => 'your_api_goes_here',
       'type' => 'text',
       'senderid' => 'sender_id'
   ]
);
$status = $sender->send();

Sample Code SSLCommerz

use Xenon\LaravelBDSms\Provider\Ssl;
use Xenon\LaravelBDSms\Sender;

$sender = Sender::getInstance();
$sender->setProvider(Ssl::class); 
$sender->setMobile('017XXYYZZAA');
$sender->setMessage('helloooooooo boss!');
$sender->setConfig(
   [
       'api_token' => 'api token goes here',
       'sid' => 'text',
       'csms_id' => 'sender_id'
   ]
);
$status = $sender->send();

Sample Code MimSMS

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->setConfig(
   [
       'api_key' => 'api_key_goes_here',
       'type' => 'text',
       'senderid' => 'approved_send_id',
   ]
);

$status = $sender->send();

Demo Response Using SSL

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!"
]

Currently Supported SMS Gateways

  • BDBulkSMS
  • BulkSMSBD
  • Dianahost
  • MDLSMS
  • Metronet
  • Mobireach
  • OnnoRokomSMS
  • SSLSms
  • Tense

We are continuously working in this open source library for adding more Bangladeshi sms gateway. If you feel something is missing then make a issue regarding that. If you want to contribute in this library, then you are highly welcome to do that....

For clear documentation read this blog in Medium!