2017 © Pedro Peláez
 

library plivo

Plivo SMS notifications driver for Laravel

image

laravel-notification-channels/plivo

Plivo SMS notifications driver for Laravel

  • Tuesday, March 27, 2018
  • by laravel-notification-channels
  • Repository
  • 6 Watchers
  • 5 Stars
  • 5,177 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 8 Versions
  • 10 % Grown

The README.md

Plivo notifications channel for Laravel

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads, (*1)

This package makes it easy to send SMS notifications using Plivo with Laravel 6.x and higher., (*2)

Contents

Installation

Install the package via composer:, (*3)

composer require laravel-notification-channels/plivo

Setting up your Plivo service

Log in to your Plivo dashboard and grab your Auth Id, Auth Token and the phone number you're sending from. Add them to config/services.php., (*4)

// config/services.php
...
'plivo' => [
    'auth_id' => env('PLIVO_AUTH_ID'),
    'auth_token' => env('PLIVO_AUTH_TOKEN'),
    // Country code, area code and number without symbols or spaces
    'from_number' => env('PLIVO_FROM_NUMBER'),
],

Usage

Follow Laravel's documentation to add the channel your Notification class:, (*5)

use Illuminate\Notifications\Notification;
use NotificationChannels\Plivo\PlivoChannel;
use NotificationChannels\Plivo\PlivoMessage;

public function via($notifiable)
{
    return [PlivoChannel::class];
}

public function toPlivo($notifiable)
{
    return (new PlivoMessage)
                    ->content('This is a test SMS via Plivo using Laravel Notifications!');
}

Add a routeNotificationForPlivo method to your Notifiable model to return the phone number:, (*6)

public function routeNotificationForPlivo()
{
    // Country code, area code and number without symbols or spaces
    return preg_replace('/\D+/', '', $this->phone_number);
}

Available methods

  • content() - (string), SMS notification body
  • from() - (integer) Override default from number

Changelog

Please see CHANGELOG for more information what has changed recently., (*7)

Testing

bash $ composer test, (*8)

Security

If you discover any security related issues, please email sid@koomai.net instead of using the issue tracker., (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

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

The Versions

27/08 2016

v1.0.2

1.0.2.0 https://github.com/laravel-notification-channels/plivo

Plivo SMS notifications driver for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel notifications plivo

25/08 2016
25/08 2016