定制 quanle/laravel-td-notification-channel 二次开发

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

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

quanle/laravel-td-notification-channel

最新稳定版本:1.0.1

Composer 安装命令:

composer require quanle/laravel-td-notification-channel

包简介

Treasure Data Notification Channel for Laravel

README 文档

README

Treasure Data notifications channel for Laravel

tests StyleCI

This package fork from mkohei/laravel-td-notification-channel

This package makes it easy to send Treasure Data using the Laravel notification system and the Treasure Data Postback API.

Contents

Installation

composer require quanle/laravel-td-notification-channel

Usage

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

use QuanLe\LaravelTdNotificationChannel\TreasureDataChannel;
use QuanLe\LaravelTdNotificationChannel\TreasureDataMessage;
use Illuminate\Notifications\Notification;

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

    public function toTreasureData($notifiable)
    {
        return TreasureDataMessage::create()
            ->data([
               'param1' => 'value',
               'param2' => 1234,
            ])
            ->apikey('YOUR_WRITE_ONLY_KEY')
            ->database('your_db')
            ->table('your_table');
    }
}

To store notifications in the appropriate regions, databases, and tables, define a routeNotificationForTreasureData method on your notifiable entity. This should return the Postback API endpoint for your region.

public function routeNotificationForTreasureData()
{
    return 'https://in.treasuredata.com';
}

Testing

composer test

License

MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-07