2017 © Pedro Peláez
 

library panaceamobile

PanaceaMobile Notifications driver.

image

sbudah/panaceamobile

PanaceaMobile Notifications driver.

  • Wednesday, August 24, 2016
  • by Sbudah
  • Repository
  • 1 Watchers
  • 1 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

PanaceaMobile notifications channel for Laravel 5.3 [WIP]

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

This package makes it easy to send notifications using PanaceaMobile with Laravel 5.3., (*2)

Contents

Installation

You can install the package via composer:, (*3)

composer require sbudah/panaceamobile

You must install the service provider:, (*4)

// config/app.php
'providers' => [
    ...
    NotificationChannels\PanaceaMobile\PanaceaMobileServiceProvider::class,
];

Setting up the PanaceaMobile service

Create an account at Panacea Mobile and create an API token., (*5)

Add your PanaceaMobile login, secret key (hashed password) and default sender name to your config/services.php:, (*6)

// config/services.php

'panaceamobile' => [
    'login'  => env('PANACEAMOBILE_LOGIN'), // Your Username
    'secret' => env('PANACEAMOBILE_SECRET'), // Your Token
    'sender' => 'Sbudah' // Phone number to send SMS from
]

Usage

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

use Illuminate\Notifications\Notification;
use NotificationChannels\PanaceaMobile\PanaceaMobileMessage;
use NotificationChannels\PanaceaMobile\PanaceaMobileChannel;

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

    public function toPanaceaMobile($notifiable)
    {
        return (new PanaceaMobileMessage())
            ->content("Your {$notifiable->service} account was approved!");
    }
}

In order to let your Notification know which phone are you sending/calling to, the channel will look for the phone_number attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForPanaceaMobile method to your Notifiable model., (*8)

// app/User.php

public function routeNotificationForPanaceaMobile()
{
    return '27111000101';
}

Example #2, (*9)

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the Nexmo channel.
     *
     * @return string
     */
    public function routeNotificationForPanaceaMobile()
    {
        return $this->phone;
    }
}

Available methods

  • ->content(''): Specifies the SMS content/text.

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

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

The Versions

24/08 2016

dev-master

9999999-dev https://github.com/sbudah/panaceamobile

PanaceaMobile Notifications driver.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sibusiso Mbuli

laravel notifications smsc smscentre

24/08 2016

0.0.5

0.0.5.0 https://github.com/sbudah/panaceamobile

PanaceaMobile Notifications driver.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sibusiso Mbuli

laravel notifications smsc smscentre

24/08 2016

0.0.4

0.0.4.0 https://github.com/sbudah/panaceamobile

PanaceaMobile Notifications driver.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sibusiso Mbuli

laravel notifications smsc smscentre

24/08 2016

0.0.3

0.0.3.0 https://github.com/sbudah/panaceamobile

PanaceaMobile Notifications driver.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sibusiso Mbuli

laravel notifications smsc smscentre

24/08 2016

v0.0.3-alpha

0.0.3.0-alpha https://github.com/sbudah/panaceamobile

PanaceaMobile Notifications driver.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sibusiso Mbuli

laravel notifications smsc smscentre

13/08 2016

v0.0.1

0.0.1.0 https://github.com/laravel-notification-channels/smsc-ru

SmscRu Notifications driver.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel notifications smsc smscentre СМС-Центр