Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
arif98741 committed Jan 17, 2022
1 parent 8074881 commit 43dd3cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 128 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xenon/laravelbdsms",
"description": "This is package for sending sms to Bangladeshi mobile numbers using laravel application",
"name": "xenon/multicourier",
"description": "This is a courier api endpoints library for interacting such as e-courier, dhl, pathao etc",
"type": "library",
"license": "MIT",
"authors": [
Expand All @@ -25,7 +25,7 @@
"aliases": {
"Courier": "Xenon\\MultiCourier\\Facades\\SMS",
"MultiCourier": "Xenon\\MultiCourier\\Facades\\SMS",
"LaravelBDSmsLogger": "Xenon\\LaravelBDSms\\Facades\\Logger"
"LaravelBDSmsLogger": "Xenon\\MultiCourier\\Facades\\Logger"
}
}
}
Expand Down
140 changes: 15 additions & 125 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,150 +20,40 @@ composer require xenon/laravelbdsms
Then, publish the package

```
php artisan vendor:publish --provider=Xenon\LaravelBDSms\LaravelBDSmsServiceProvider
php artisan vendor:publish --provider=Xenon\MultiCourier\MultiCourierServiceProvider
```

### Step 3:

Select Vendor From Console <br>
<img src="https://raw.githubusercontent.com/arif98741/laravelbdsms/master/img/installation.png" style="width: 60%; height: 60%">

### Step 4:

```
php artisan config:cache && php artisan migrate
```

This will create a `sms.php` in the `config/` directory and also table in your database. Set your desired provider as `default_provider` and fill up the
necessary environment variable of that provider.

# Usage

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

SMS::shoot('017XXYYZZAA', 'helloooooooo boss!');
</pre>

Or, with facade alias
<pre>
use LaravelBDSms;

LaravelBDSms::shoot('017XXYYZZAA', 'helloooooooo boss!');
</pre>

Or, if you need to change the default provider on the fly
<pre>
use Xenon\LaravelBDSms\Facades\SMS;
use Xenon\LaravelBDSms\Provider\Ssl;

$response = SMS::via(Ssl::class)->shoot('017XXYYZZAA', 'helloooooooo boss!');
</pre>
That should do it.

#

Otherwise, if you want more control, you can use the underlying sender object. This will not touch any laravel facade or
service provider.

#### Sample Code DianaHost
#### Sample Code Requesting to E-courier

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

#### Sample Code SSLCommerz
use Xenon\MultiCourier\Provider\ECourier;
use Xenon\MultiCourier\Sender;

<pre>
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();
$sender->setProvider(ECourier::class,'production');
$sender->setConfig([
'API-KEY' => 'XXX',
'API-SECRET' => 'XXX',
'USER-ID' => 'XXXX',
]);
$sender->setRequestEndpoint('packages', ['city' => 'Tangail']);
$response = $sender->send();
echo $response->getData();
</pre>

#### Sample Code MimSMS

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

#

### Demo Response Using SSL
#### Currently Supported Courier Gateways

<pre>
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!"
]
</pre>
* ECourier

#### Currently Supported SMS Gateways

* AjuraTech
* BDBulkSMS
* BoomCast
* BulkSMSBD
* Dianahost
* ElitBuzz
* Infobip
* MDLSMS
* Metronet
* Mobireach
* OnnoRokomSMS
* SSLSms
* Tense
* TwentyFourSmsBD

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!](https://send-sms-using-laravelbdsms.medium.com/laravel-sms-gateway-package-for-bangladesh-e70af99f2060)

0 comments on commit 43dd3cc

Please sign in to comment.