PHP code example of innoflash / za-sms

1. Go to this page and download the library: Download innoflash/za-sms 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/ */

    

innoflash / za-sms example snippets


    function routeNotificationForZasms($notification)
    {
        return $this->phone_number;
    }

    public function via($notifiable)
    {
        return [ZaSMSChannel::class];
    }

    function toZaSMS($notifiable)
    {
        return (new ZaSMS)
            ->message('This is my message')  
            ->sendAt(now()->addDays(2)) // for scheduling messegaes 
            ->campaign('my campain'); //for message campaining
    }

    ZaSMS::setRecipientNumber('0651562779')
        ->setMessage('the facade message')
        ->sendMessage();

    //or

    ZaSMS::setMessageData([
        'recipientNumber' => '0027651562779',
        'message' => 'data message'
        ])->sendMessage();

    $provider = app()->make('za-sms');
    $provider = app()->make(SMSProviderContract::class);

    $provider = resolve('za-sms');
    $provider = resolve(SMSProviderContract::class);

    //or use dependency injection

    function myFunction(SMSProviderContract $provider){
        //todo use the provider
    }