Mobitel Sri Lanka's Messaging Solutions aka MSMS Library for Laravel
This service provides any organization with a secure method of sending and receiving bulk amounts of short messages to their group of customers or even employees.
iXeun Web Solution made an easy Library for Laravel to send SMS using Messaging Solutions.
We will update this Library as Composer Package as soon as possible. this approach will be easy for using too :) - don't blame me for that :D :D
cd yourapp/app && mkdir Library
mv or copy MobitelSMS.php to Library
//import our Library
use App\Library\MobitelSms;
class RegisterController extends Controller
{
//your controller method
protected function create(array $data) {
}
}
//create object
$sms = new MobitelSms();
//Make Session
$session = $sms->sessionMake();
//Make SMS and Send
/*
* @message - string
* @PhoneNumber - array / @string
*/
$send = $sms->fireSms($session, $Message, $phoneNumber);
//Get Delivery info
/*
* $mask - string
*/
$delivery = $sms->statusDelivery($session, 'YOUR MASK');
//close session
$close = $sms->sessionClose($session);
$number = isset($_GET['incoming_number']);
$message = isset($_GET['incoming_message']);
//create a session with mobitel given username & password
$session = createSession('','USERNAME','PASSWORD','');
//send message with created session like this
sendMessages($session, 'YOUR MASK', $message, array($number), 0);
//close session & check your phone ;)
closeSession($session);
Refer This File for Full Code - https://github.com/joeljerushan/Mobitel-SMS/blob/master/pure.php
let sms = 'Hello From Black Box Pvt Ltd.'
const params = 'http://localhost:8888/?incoming_number=94777878551&incoming_message=' + sms;
axios({
method: 'post',
url: params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
}
}).then(function (response) {
//get status
console.log(response)
}).catch(function (error) {
//know what caused error
console.log(error)
});