2017 © Pedro Peláez
 

library mobizon

Mobizon Notifications channel for Laravel 5.3.*

image

laraketai/mobizon

Mobizon Notifications channel for Laravel 5.3.*

  • Saturday, March 10, 2018
  • by Laraketai
  • Repository
  • 0 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Mobizon notifications channel for Laravel 5.3+

Latest Version on Packagist Software License StyleCI Total Downloads, (*1)

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

Contents

Installation

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

composer require laraketai/mobizon

Laravel 5.5 < Add the service provider to config/app.php:, (*4)

// config/app.php
'providers' => [
    ...
    Laraketai\Mobizon\MobizonServiceProvider::class,
],

Publish Config File config/mobizon.php:, (*5)

php artisan vendor:publish --provider="Laraketai\Mobizon\MobizonServiceProvider"

Setting up your Mobizon service

Log in to your Mobizon and grab your Api, Api Secret Key. Add them to config/services.php., (*6)

// config/mobizon.php
...
'mobizon' => [
    'alphaname' => null, //Optional, if you don't have registered alphaname, just skip this param and your message will be sent with our free common alphaname.
    'secret' => env('MOBIZON_APP_KEY'), // Your secret API key
],

Usage

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

use Illuminate\Notifications\Notification;
use Laraketai\Mobizon\MobizonChannel;
use Laraketai\Mobizon\MobizonMessage;

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

public function toMobizon($notifiable)
{
    return MobizonMessage::create("Task #{$notifiable->id} is complete!");
}

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

public function routeNotificationForMobizon()
{
    //Phone Number without symbols or spaces
    return $this->phone_number;
}

Available methods

  • content() - (string), SMS notification body

Changelog

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

Testing

bash $ composer test, (*10)

Security

If you discover any security related issues, please email sanzhar@aketai.com instead of using the issue tracker., (*11)

Contributing

Please see CONTRIBUTING for details., (*12)

Credits

License

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

The Versions