PHP code example of franckysolo / laravel-octopush-sdk

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

    

franckysolo / laravel-octopush-sdk example snippets



...
$api = $this->app->make('octopush');
$credit = $api->getCredit();


...
$api = $this->app->make('octopush');
$balance = $api->getBalance();
$premium = $api->getPremiumBalance();
$low = $api->getLowCostBalance();


...
$api = $this->app->make('octopush');
$message = 'this is a simple sms message';
$api->sendMessage($message, [
  'sms_recipients' => TEST_PHONE_NUMBER,
  'sms_text' => $message,
  'sms_type' => Message::SMS_PREMIUM,
  'sms_sender' => 'Laravel Octopush sdk',
]);


$api = $this->app->make('octopush');

$message = 'Hello {ch1} {nom} {prenom}, your session begin at {ch2} the {ch3}';

$api->sendMessage($message, [
  'sms_recipients' => [TEST_PHONE_NUMBER, TEST_PHONE_NUMBER_ALT],
  'sms_text' => $message,
  'sms_type' => Message::SMS_PREMIUM,
  'sms_sender' => 'Laravel Octopush sdk',
  'request_mode' => Message::SIMULATION_MODE,
  'recipients_first_names' => ['John', 'Jane'],
  'recipients_last_names' => ['John', 'Jane'],
  'sms_fields_1' => ['Mr', 'Miss'],
  'sms_fields_2' => ['08:00 am', '01:00 pm'],
  'sms_fields_3' => ['2018/05/21', '2018/05/22'],
]);