PHP code example of daemon144key / zenziva-notification-channel

1. Go to this page and download the library: Download daemon144key/zenziva-notification-channel 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/ */

    

daemon144key / zenziva-notification-channel example snippets


// config/app.php
'providers' => [
    ...
    TuxDaemon\ZenzivaNotificationChannel\ZenzivaServiceProvider::class,
],

// config/app.php
'aliases' => [
    ...
    'ZenzivaClient' => TuxDaemon\ZenzivaNotificationChannel\Facades\ZenzivaFacade::class,
],

// config/services.php
...
'zenziva' => [
    'userkey' => env('ZENZIVA_SMS_CLIENT_USERKEY', ''),
    'passkey' => env('ZENZIVA_SMS_CLIENT_PASSKEY', ''),
    'masking' => env('ZENZIVA_SMS_CLIENT_MASKING', false)
],
...

use Illuminate\Notifications\Notification;
use TuxDaemon\ZenzivaNotificationChannel\ZenzivaMessage;
use TuxDaemon\ZenzivaNotificationChannel\ZenzivaChannel;

class OrderCreated extends Notification
{
    public function via($notifiable)
    {
        return [ZenzivaChannel::class];
    }

    public function toZenziva($notifiable)
    {
        return ZenzivaMessage::create("Your order had created!");
    }
}

use ZenzivaClient;

class Something
{
    public function send($to, $msg)
    {
        return ZenzivaClient::send("081234567890", "hello world");
    }

    public function checkBalance()
    {
        return ZenzivaClient::checkBalance();
    }
}
bash
$ php artisan zenziva:send 081234567890 "hello world"
$ php artisan zenziva:checkbalance