Package Data | |
---|---|
Maintainer Username: | alhoqbani |
Maintainer Contact: | h.alhoqbani@gmail.com (Hamoud Alhoqbani) |
Package Create Date: | 2017-04-18 |
Package Last Update: | 2017-04-22 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-11 15:17:15 |
Package Statistics | |
---|---|
Total Downloads: | 42 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 5 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Under Development, Not ready for production.
This is a Laravel package to send SMS using http://mobily.ws.
Composer require alhoqhbani\mobily.ws
config/app.php
Alhoqbani\MobilyWs\MobilyWsServiceProvider::class,
php artisan vendor:publish --provider='Alhoqbani\MobilyWs\MobilyWsServiceProvider'
.env
file add your mobily.ws login detailsMOBILY_WS_MOBILE=
MOBILY_WS_PASSWORD=
MOBILY_WS_SENDER=
use Alhoqbani\MobilyWs\SMS;
$sms = new SMS();
$sms->text('This is an SMS from Mobily.ws')
->to('9665xxxxxxxx')
->send();
echo $sms->result(); // تمت عملية الإرسال بنجاح
echo $sms->balance(); // 1124
For now, numbers should be entered with the country code without leading zeros or +
You can also pass an array of numbers to the to()
method.
$sms->to(['9665xxxxxxxx', '9665xxxxxxxx']);
You can define the time to send the message by calling when();
it takes two arguments, date and time. you can pass null to either.
Format must be: dd/mm/yyyy, hh:mm:ss
$sms->text('This is an SMS from Mobily.ws')
->to('9665xxxxxxxx')
->when('10/25/2030', 06:30:00')
->send();
removeDuplicate()
Will remove all duplicate numbers and send notRepeat key to mobily.ws
domain()
Adds the domainName to the sent sms.