enniel/laravel-epochta-notification-channel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

enniel/laravel-epochta-notification-channel

Composer 安装命令:

composer require enniel/laravel-epochta-notification-channel

包简介

Epochta Notification Driver

关键字:

README 文档

README

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.

统计信息

  • 总下载量: 1.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固