Giter Site home page Giter Site logo

atymic / laravel-notification-channel-sms-broadcast Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 21 KB

Laravel Notification Channel for Sms Broadcast

License: MIT License

PHP 100.00%
sms sms-api sms-gateway laravel laravel-notifications laravel-notification-channels

laravel-notification-channel-sms-broadcast's Introduction

Sms Broadcast Notification Channel

Package Moved

This package has moved to https://github.com/laravel-notification-channels/sms-broadcast

Please update you composer.json to the new location. The namespacing has not changed, so you can just swap the packages out.


## Old Readme

This package makes it easy to send notifications using Sms Broadcast with Laravel > 5.6.

It uses my Sms Broadcast PHP package under the hood.

Contents

Installation

Install the package using composer

composer require atymic/laravel-notification-channel-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.

laravel-notification-channel-sms-broadcast's People

Contributors

atymic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.