PHP code example of shipu / banglalink-sms-gateway
1. Go to this page and download the library: Download shipu/banglalink-sms-gateway library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use \Shipu\BanglalinkSmsGateway\Services\Banglalink;
...
$sms = new Banglalink($config);
$response = $sms->message('your text here !!!', '01606022000')->send(); // Guzzle Response with request data
// For another example please see below laravel section.
return $response->autoParse(); // Getting only response contents.
use \Shipu\BanglalinkSmsGateway\Facades\Banglalink;
...
$sms = Banglalink::message('your text here !!!', '01606022000')->send(); // Guzzle Response with request data
// or
$sms = Banglalink::message('your text here !!!')->to('01606022000')->send();
// or
$sms = Banglalink::send(
[
'message' => "your text here",
'to' => '01616022000'
]
);
return $sms->autoParse(); // Getting only response contents.
$sms = Banglalink::message('your text here !!!')
->to('01616022669')
->to('01845736124')
->to('01745987364')
->send();
// or you can try below statements also
$sms = Banglalink::message('your text here !!!', '01616022669')
->to('01845736124')
->to('01745987364')
->send();
// or
$users = [
'01616022669',
'01845736124',
'01745987364'
];
$sms = Banglalink::message('your text here !!!',$users)->send();
$sms = Banglalink::message('your text here one !!!')->to('01616022669')
->message('your text here two !!!')->to('01845736124')
->message('your text here three !!!')->to('01745987364')
->send();
// or
$sms = Banglalink::message('your text here one !!!', '01616022669')
->message('your text here two !!!', '01845736124')
->message('your text here three !!!', '01745987364')
->send();
// or
$sms = Banglalink::send([
[
'message' => "your text here one !!!",
'to' => '01616022669'
],
[
'message' => "your text here two !!!",
'to' => '01707722669'
],
[
'message' => "your text here three !!!",
'to' => '01745987364'
]
]);
// or
$sms = Banglalink::message('your text here one !!!', '01616022669')->send([
[
'message' => "your text here two !!!",
'to' => '01707722669'
],
[
'message' => "your text here three !!!",
'to' => '01745987364'
]
]);