fahmiardi/laravel-notification 问题修复 & 功能扩展

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

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

fahmiardi/laravel-notification

Composer 安装命令:

composer require fahmiardi/laravel-notification

包简介

Various laravel notifications channels

README 文档

README

Available Channels:

  • AWS SNS (Simple Notification Services), support using credentials or profile

Install

$ composer require fahmiardi/laravel-notification

Setup

Add config to app/services.php:

return [
    ...
    'sns' => [
        'key' => env('SNS_KEY'),
        'secret' => env('SNS_SECRET'),
        'region' => env('SNS_REGION'),
        'profile' => env('AWS_PROFILE'), // keep this value empty when using credentials
    ],
];

Usage

Use generic:

<?php

$user->notify(
    new \Fahmiardi\Laravel\Notifications\GenericSnsNotification($topicArn, $subject, $message)
);

Create your own:

Read the official page https://laravel.com/docs/5.3/notifications#creating-notifications

<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use Fahmiardi\Laravel\Notifications\Channels\SnsChannel;
use Fahmiardi\Laravel\Notifications\Messages\SnsMessage;

class InvoicePaid extends Notification
{
    protected $invoice;

    public function __construct($invoice)
    {
        $this->invoice = $invoice;
    }

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

    public function toSns($notifiable)
    {
        return (new SnsMessage)
            ->topicArn('ARN')
            ->subject('SUBJECT')
            ->message('MESSAGE');
    }
}

$user->notify(new InvoicePaid($invoice));

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固