PHP code example of atymic / laravel-notification-channel-sms-broadcast

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

    

atymic / laravel-notification-channel-sms-broadcast example snippets


'smsbroadcast' => [
    'username' => env('SMS_BROADCAST_USERNAME'),
    'password' => env('SMS_BROADCAST_PASSWORD'),
    'default_sender' => env('SMS_BROADCAST_DEFAULT_SENDER', null),
]

use Illuminate\Notifications\Notification;
use NotificationChannels\SmsBroadcast\SmsBroadcastMessage;
use NotificationChannels\SmsBroadcast\SmsBroadcastChannel;

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

    public function toSmsbroadcast($notifiable)
    {
        return (new SmsBroadcastMessage)
            ->content("Task #{$notifiable->id} is complete!");
    }
}

public function routeNotificationForSmsbroadcast()
{
    return $this->phone; // 0412345678 or 6142345678
}