PHP code example of superbalist / simple-sms-panacea-mobile

1. Go to this page and download the library: Download superbalist/simple-sms-panacea-mobile 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/ */

    

superbalist / simple-sms-panacea-mobile example snippets


// ...
'panacea_mobile' => [
    'username' => env('PANACEA_MOBILE_USERNAME'),
    'password' => env('PANACEA_MOBILE_PASSWORD')
],

'providers' => [
    // ...
    Superbalist\SimpleSMSPanaceaMobile\PanaceaMobileSMSServiceProvider::class,
]

// if 'panacea_mobile' is your default simplesms driver - `SMS_DRIVER`
$sms = app('sms'); /** @var \SimpleSoftwareIO\SMS\SMS $sms */

// send a simple message
$sms->send('This is my message content', [], function (OutgoingMessage $sms) {
    $sms->to('+27000000000');
});

// send a message from a view file
$viewData = [
    'lorem' => 'ipsum',
];
$sms->send('path.to.my.view.file' $viewData, function (OutgoingMessage $sms) {
    $sms->to('+27000000000');
});

// if 'panacea_mobile' is not your default driver
$sms->driver('panacea_mobile')->send('This is my message content', [], function (OutgoingMessage $sms) {
    $sms->to('+27000000000');
});

// see https://www.simplesoftware.io/docs/simple-sms#docs-usage for more usage examples

PANACEA_MOBILE_USERNAME=null
PANACEA_MOBILE_PASSWORD = null
bash
php artisan vendor:publish --provider="SimpleSoftwareIO\SMS\SMSServiceProvider"