PHP code example of unicodeveloper / laravel-jusibe

1. Go to this page and download the library: Download unicodeveloper/laravel-jusibe 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/ */

    

unicodeveloper / laravel-jusibe example snippets


'aliases' => [
    ...
    'Jusibe' => Unicodeveloper\JusibePack\Facades\Jusibe::class,
    ...
]



return [
    /**
     * Public Key From Jusibe Dashboard
     *
     */
    'publicKey' => getenv('JUSIBE_PUBLIC_KEY'),
    /**
     * Access Token From Jusibe  Dashboard
     *
     */
    'accessToken' => getenv('JUSIBE_ACCESS_TOKEN'),
];


/**
 * Send SMS using the Jusibe API
 * @param  array $payload
 * @return object
 */
Jusibe::sendSMS($payload)->getResponse();

/**
 * Check the available SMS credits left in your Jusibe account
 * @return object
 */
Jusibe::checkAvailableCredits()->getResponse();

/**
 * Check the delivery status of a sent SMS
 * @param  string $messageID
 * @return object
 */
Jusibe::checkDeliveryStatus('8nb1wrgdjw')->getResponse();




$message = "I LOVE YOU, BABY";

$payload = [
    'to' => '7079740987',
    'from' => 'PROSPER DATING NETWORK',
    'message' => $message
];

try {
    $response = Jusibe::sendSMS($payload)->getResponse();
    print_r($response);
} catch(Exception $e) {
    echo $e->getMessage();
}





try {
   $response = Jusibe::checkAvailableCredits()->getResponse();
   print_r($response);
} catch(Exception $e) {
   echo $e->getMessage();
}





try {
    $response = Jusibe::checkDeliveryStatus('8nb1wrgdjw')->getResponse();
    print_r($response);
} catch(Exception $e) {
    echo $e->getMessage();
}





// include your composer dependencies
y = 'xxxxxxxxxxxxxx';
$accessToken = 'xxxxxxxxxxxxxx';

$jusibe = new Jusibe($publicKey, $accessToken);

$message = "You are invited for party!!!";

$payload = [
    'to' => '7079740987,8077139164',
    'from' => 'DOZIE GROUP',
    'message' => $message
];

try {
    $response = $jusibe->sendBulkSMS($payload)->getResponse();
    print_r($response);
} catch(Exception $e) {
    echo $e->getMessage();
}





// include your composer dependencies
y = 'xxxxxxxxxxxxxx';
$accessToken = 'xxxxxxxxxxxxxx';

$jusibe = new Jusibe($publicKey, $accessToken);

try {
    $response = $jusibe->checkBulkDeliveryStatus('n2v9gby1jy')->getResponse();
    print_r($response);
} catch(Exception $e) {
    echo $e->getMessage();
}

bash
php artisan vendor:publish --provider="Unicodeveloper\JusibePack\JusibeServiceProvider"