定制 laravel-notification-channels/gitter 二次开发

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

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

laravel-notification-channels/gitter

Composer 安装命令:

composer require laravel-notification-channels/gitter

包简介

Gitter Notifications channel for Laravel

README 文档

README

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using Gitter.im with Laravel 5.5+, 6.x & 7.x.

Contents

Installation

Install this package with Composer:

composer require laravel-notification-channels/gitter

If you're using Laravel 5.x you'll also need to specify a version constraint:

composer require laravel-notification-channels/gitter -v 1.0.1

Setting up the Gitter service

In order to send message to Gitter rooms, you need to obtain Personal Access Token or application token.

Usage

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

use Illuminate\Notifications\Notification;
use NotificationChannels\Gitter\GitterMessage;
use NotificationChannels\Gitter\GitterChannel;

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

    public function toGitter($notifiable)
    {
        return GitterMessage::create("Task #{$notifiable->id} is complete!")
            ->room('room_id') // optional
            ->from('user_or_app_access_token');
    }
}

In order to let your notification know which Gitter room you are targeting, add the routeNotificationForGitter method to your Notifiable model:

public function routeNotificationForGitter()
{
    return 'room_id';
}

Available methods

from(): Sets the sender's access token.

room(): Specifies the room id to send the notification to (overridden by routeNotificationForGitter if empty).

content(): Sets a content of the notification message. Supports Github flavoured markdown.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email jhaoda@gmail.com instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固