定制 hotrush/laravel-log-notification-channel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hotrush/laravel-log-notification-channel

最新稳定版本:0.4.0

Composer 安装命令:

composer require hotrush/laravel-log-notification-channel

包简介

Log notifications channel for laravel

README 文档

README

Latest Version on Packagist Software License Total Downloads

Send notifications into log with Laravel, easier to pretend other services e.g. sms or push notifications.

Contents

Installation

composer require hotrush/laravel-log-notification-channel

Setting up the log service

You can add LOG_NOTIFICATIONS_CHANNEL into your .env file to customize log channel to use, otherwise default one will be used.

Usage

<?php

namespace App\Notifications;

use App\Post;
use Illuminate\Notifications\Notification;
use NotificationChannels\Log\LogChannel;
use NotificationChannels\Twilio\TwilioChannel;
use NotificationChannels\Log\LogMessage;


class AuthCodeCreatedNotification extends Notification
{
    /**
     * @var Post
     */
    private $post;

    /**
     * Create a new notification instance.
     *
     * @param Post $post
     * @return void
     */
    public function __construct(Post $post)
    {
        $this->post = $post;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return app()->environment('production')
            ? [TwilioChannel::class]
            : [LogChannel::class];
    }

    /**
     * Get the log message representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return LogMessage
     */
    public function toLog($notifiable)
    {
        return new LogMessage('Pretended sms send to :number and with content: :content');
    }
}

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固