PHP code example of toneflix-code / kudisms-notification

1. Go to this page and download the library: Download toneflix-code/kudisms-notification 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/ */

    

toneflix-code / kudisms-notification example snippets


use ToneflixCode\KudiSmsNotification\KudiSmsChannel;
use ToneflixCode\KudiSmsNotification\KudiSmsMessage;
use Illuminate\Notifications\Notification;

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

    public function toKudiSms($notifiable)
    {
        return (new KudiSmsMessage())
            ->message("Your {$notifiable->service} account was approved!");
    }
}

use ToneflixCode\KudiSmsNotification\KudiSmsChannel;
use ToneflixCode\KudiSmsNotification\KudiSmsVoiceMessage;
use Illuminate\Notifications\Notification;

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

    public function toTwilio($notifiable)
    {
        return (new KudiSmsVoiceMessage())
            ->url("https://download.samplelib.com/mp3/sample-3s.mp3");
    }
}

public function routeNotificationForKudiSms()
{
    return '+2349034567890';
}

/config/kudi-notification.php
 php
use ToneflixCode\KudiSmsNotification\KudiSmsChannel;
use ToneflixCode\KudiSmsNotification\KudiSmsTTSMessage;
use Illuminate\Notifications\Notification;

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

    public function toTwilio($notifiable)
    {
        return (new KudiSmsTTSMessage())
            ->message("Hello {$notifiable->name}, how are you today?");
    }
}