PHP code example of nahid / php-sslwireless-sms

1. Go to this page and download the library: Download nahid/php-sslwireless-sms 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/ */

    

nahid / php-sslwireless-sms example snippets


Nahid\SslWSms\SslWSmsServiceProvider::class,

'Sms'   =>  Nahid\SslWSms\Facades\Sms::class,

use Nahid\SslWSms\Sms;

$config = [
    'sid' => '',
    'user' => '',
    'password'=> ''
];

$sms = new Sms($config);

return [
    'sid' => '',
    'user' => '',
    'password'=> ''
];

$sms = new Sms($config);
$msg = $sms->message('0170420420', 'Hello Dear')->send();

if ($msg->parameter == 'ok' and $msg->login == 'successfull') {
    echo 'Messages Sent';
}

use Nahid\SslWSms\Facades\Sms;

$msg = Sms::message('0170420420', 'Hello Dear')->send();

if ($msg->parameter == 'ok' and $msg->login == 'successfull') {
    echo 'Messages Sent';
}

$msg = $sms->message('0170420420', 'Hello Dear')
        ->message('0160420420', 'Hello Dear Uncle')
        ->message('0150420420', 'Hello Dear Trump')
        ->send();

if ($msg->parameter == 'ok' and $msg->login == 'successfull') {
    echo 'Messages Sent';
}

$users = [
    ['01670420420', 'Hello Trump'],
    ['01970420420', 'Hello Bush'],
    ['01770420420', 'Hello Hilari'],
    ['01570420420', 'Hello Obama'],
    ['01870420420', 'Hello Hero Alom']
]

$msg = $sms->message($users)->send();

if ($msg->parameter == 'ok' and $msg->login == 'successfull') {
    echo 'Messages Sent';
}

$users = [
    ['01670420420'],
    ['01970420420'],
    ['01770420420'],
    ['01570420420'],
    ['01870420420']
]

$msg = $sms->message($users, 'Hello Everyone')->send();

if ($msg->parameter == 'ok' and $msg->login == 'successfull') {
    echo 'Messages Sent';
}

$users = [
    ['01670420420', ['Nahid', '1234']],
    ['01970420420', ['Obi', '3213']],
    ['01770420420', ['Shipu', '5000']],
    ['01570420420', ['Kaiser', '3214']],
    ['01870420420', ['Eather', '7642']]
]

$msg = $sms->message($users, "Hello %s , Your promo code is: %s")->send();

if ($msg->parameter == 'ok' and $msg->login == 'successfull') {
    echo 'Messages Sent';
}
shell
composer 
shell
php artisan vendor:publish --provider="Nahid\SslWSms\SslWSmsServiceProvider"