PHP code example of zhandos-prog / mobizon-sms-driver

1. Go to this page and download the library: Download zhandos-prog/mobizon-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/ */

    

zhandos-prog / mobizon-sms-driver example snippets


// Eg. if you want to use MobizonSmsDriver.
'default' => 'smsmobizon',

// Eg. for MobizonSmsDriver.
'drivers' => [
    'smsmobizon' => [
        // Fill all the credentials here.
        'apiKey' => 'Your Api Key',
        'from' => 'Your Mobizon Sender ID',
        'url' => 'Your Url Api'
    ],
    ...
]

// Eg. for MobizonSmsDriver.
'map' => [
    ...
    'smsmobizon' => ZhandosProg\MobizonSmsDriver\Driver\MobizonDriver::class,
]

// Eg. for MobizonSmsDriver.
'providers' => [
    ...
    ZhandosProg\MobizonSmsDriver\MobizonServiceProvider::class,
]

use ZhandosProg\MobizonSmsDriver\MobizonSenderSMSInterface;

Class ExampleController {
    
    private MobizonSenderSMSInterface $mobizonSenderSMS;
    
    public function __construct(MobizonSenderSMSInterface $mobizonSenderSMS)
    {
        $this->mobizonSenderSMS = $mobizonSenderSMS
    }
    
    public function single()
    {
        /// ... your logic
       
        $response = $this->mobizonSenderSMS->send('77779998877', '42')
        dd($response);
        
        /// ... your logic
    }
    
    public function mass()
    {
        /// ... your logic
       
        $response = $this->mobizonSenderSMS->send(['77773335566','87774444242'], '42')
        dd($response);
        
        /// ... your logic
    }
}

bash
$ php artisan sms:publish