enniel/laravel-epochta-notification-channel

Epochta Notification Driver
1,478
Install
composer require enniel/laravel-epochta-notification-channel
Latest Version:v0.0.1
PHP:>=5.5.9
License:MIT
Last Updated:Oct 21, 2016
Links: GitHub  ·  Packagist
Maintainer: enniel

Epochta notification channel for Laravel 5.3

This package makes it easy to send notifications using Epochta aka Atompark with Laravel 5.3.

Contents

Installation

You can install this package via composer:

composer require enniel/laravel-epochta-notification-channel

Next add the service provider to your config/app.php:

...
'providers' => [
    ...
     NotificationChannels\Epochta\EpochtaServiceProvider::class,
],
...

Setting up the configuration

Add your private and public keys to your config/services.php:

// config/services.php
...
'epochta' => [
    'sms' => [
        'public_key' => env('EPOCHTA_SMS_PUBLIC_KEY'),
        'private_key' => env('EPOCHTA_SMS_PRIVATE_KEY'),
    ],
],
...

Usage

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

use NotificationChannels\Epochta\EpochtaChannel;
use NotificationChannels\Epochta\EpochtaMessage;
use Illuminate\Notifications\Notification;

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

    public function toEpochta($notifiable)
    {
        return (new EpochtaMessage())
            ->text('message text')
            ->sender('test');
    }
}

In order to let your Notification know which phone number you are targeting, add the routeNotificationForEpochta method to your Notifiable model.

Available message methods

  • from(): The identity of the sender.
  • text(): The text of the message.
  • to(): Recipient's phone number.
  • at(): Sending a message at a specified time.
  • life(): Life time SMS (0 = maximum, 1, 6, 12, 24 hours).
  • type(): For Russia it is possible to specify the type of distribution type parameter.

Testing

$ composer test

Credits

License

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

Related Packages

laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

8,725,294 258
rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authe...

77,746 32
toplan/laravel-sms

A mobile phone number validation solution based on laravel

80,254 835
laravel-notification-channels/authy

Authy notification channel for Laravel, with the ability to send in-app, sms, an...

46,701 57
kavenegar/laravel

laravel 4 and 5 kavenegar integration

356,409 85