PHP code example of ibrahem-kamal / omni-messaging-jawaly-sms-driver

1. Go to this page and download the library: Download ibrahem-kamal/omni-messaging-jawaly-sms-driver 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/ */

    

ibrahem-kamal / omni-messaging-jawaly-sms-driver example snippets


   'channels' => [
        'jawaly'=> [
            'driver' => 'jawaly',
            'options' => [
                'username' => env('JAWALY_USERNAME'),
                'password' => env('JAWALY_PASSWORD'),
                'sender_name' => env('JAWALY_SENDER_NAME'),
            ]
        ]
    ]

$sms = OmniMessaging::driver('jawaly')->send($message,$mobileNumber,$sender,$options = []);
    $sms->isSuccess(); //bool
    $sms->getErrorsString(); // errors as string
    $sms->getErrors(); // errors as array
    $sms->getData(); // array of data returned from the gateway
    $sms->toArray(); // array of all the above