PHP code example of nstechns / jazzcms-laravel

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

    

nstechns / jazzcms-laravel example snippets


'providers' => [
    // ...
    NsTechNs\JazzCMS\JazzCMSServiceProvider::class,
];

return [
    /*
    * In order to integrate the JAZZ - Campaign Management Solution into your site,
    * you'll need to connect to JAZZ/ Mobilink company to get the credential of SMS API
    *
    * Using environment variables is the recommended way of
    * storing your username, password and mask. Make sure to update
    * your /.env file with your USERNAME, PASSWORD and From MASK.
    */

    'base_url' => env('JAZZ_CMS_URL', 'https://connect.jazzcmt.com'),

    'username' => env('JAZZ_CMS_USERNAME'),

    'password' => env('JAZZ_CMS_PASSWORD'),

    'from' => env('JAZZ_CMS_MASK'),

    'is_urdu' => env('JAZZ_IS_URDU', false),

    'show_status' => env('JAZZ_SHOW_STATUS', true),

    'short_code' => env('JAZZ_SHORT_CODE'),
];

use NsTechNs\JazzCMS\JazzCMS;
$response = (new JazzCMS)->sendSMS("030xxxxxxxx","message text");
// OR with extra parameters 
$response = (new JazzCMS)->sendSMS("030xxxxxxxx","message text", "identifier", "unique_id", "product_id", "channel", "transaction_id");


 ^ {#173 ▼
  +"request": array:7 [▼
    "request_size" => 310
    "curl_error" => ""
    "base_url" => "https://connect.jazzcmt.com"
    "content_type" => "text/html; charset=UTF-8"
    "redirect_count" => 0
    "effective_url" => "https://connect.jazzcmt.com/sendsms_xml.html"
    "total_time" => 1.511816
  ]
  +"http_code": 200
  +"data": array:7 [▼
    "statuscode" => "300"
    "statusmessage" => "Message Sent Successfully!"
    "messageid" => "31"
    "originator" => "MyMask"
    "recipient" => "9230xxxxxxxx"
    "responsedatetime" => "2021-06-30 17:13:53"
    "messagedata" => "testing"
  ]
  +"status": "success"
}


use NsTechNs\JazzCMS\JazzCMS;
$response = (new JazzCMS)->receivingSMS("From Date", "To Date");

use NsTechNs\JazzCMS\JazzCMS;
$response = (new JazzCMS)->balanceInquiry();

use NsTechNs\JazzCMS\JazzCMS;
$response = (new JazzCMS)->sendSMSGroups("Group Name", "Message Text");

use NsTechNs\JazzCMS\JazzCMS;
$response = (new JazzCMS)->sendSMSInternational("030xxxxxxxx", "Message Text");

use NsTechNs\JazzCMS\JazzCMS;
$response = (new JazzCMS)->scheduleJob("file_with_path", "Message Text", "Schedule Date Time");
bash
php artisan vendor:publish --provider="NsTechNs\JazzCMS\JazzCMSServiceProvider" --tag="config"