LaravelPackages.net
Acme Inc.
Toggle sidebar
devineonline/smsbroadcast-laravel-notifcation-channel

SMS Broadcast Notification Channel

11
0
8.4
About devineonline/smsbroadcast-laravel-notifcation-channel

devineonline/smsbroadcast-laravel-notifcation-channel is a Laravel package for sms broadcast notification channel. It currently has 0 GitHub stars and 11 downloads on Packagist (latest version 8.4). Install it with composer require devineonline/smsbroadcast-laravel-notifcation-channel. Discover more Laravel packages by devineonline or browse all Laravel packages to compare alternatives.

Last updated

Sms Broadcast Notification Channel

This package makes it easy to send notifications using Sms Broadcast with Laravel 8 This is a fork for laravel 8 support, original info below:

It uses my Sms Broadcast PHP package under the hood.

Contents

Installation

Install the package using composer

composer require laravel-notification-channels/sms-broadcast

Add the configuration to your services.php config file:

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

Usage

You can use the channel in your via() method inside the notification:

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!");
    }
}

In your notifiable model, make sure to include a routeNotificationForSmsbroadcast() method, which returns an australian phone number.

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

Available methods

sender(): Sets the sender's name or phone number.

content(): Set a content of the notification message.

delay(): Set a delay, in minutes before sending the message

reference(): Set the SMS ref code

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Star History Chart