PHP code example of kwtsms / kwtsms-notification-channel

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

    

kwtsms / kwtsms-notification-channel example snippets


use Illuminate\Notifications\Notification;
use NotificationChannels\KwtSms\KwtSmsChannel;
use NotificationChannels\KwtSms\KwtSmsMessage;

class OrderShipped extends Notification
{
    public function via($notifiable): array
    {
        return [KwtSmsChannel::class];
    }

    public function toKwtSms($notifiable): KwtSmsMessage
    {
        return KwtSmsMessage::create("Your order #{$this->order->id} has been shipped!");
    }
}

public function routeNotificationForKwtSms($notification): string
{
    return $this->phone; // International format: 96598765432
}

public function toKwtSms($notifiable): string
{
    return 'Your order has been shipped!';
}
bash
php artisan vendor:publish --provider="NotificationChannels\KwtSms\KwtSmsServiceProvider" --tag="config"