zaxxas/laravel-simple-chat-notification
Composer 安装命令:
composer require zaxxas/laravel-simple-chat-notification
包简介
This package is implemented for notifying to specified chat tools (slack, .etc)
README 文档
README
This repository is a library for Laravel to notify business chat tools. Currently, the following are covered
- Slack (webhook only)
- Teams (webhook only)
- Line ( Line Notify only)
Currently, it can only send notifications synchronously. Asynchronous support will be added in the future.
Usage
-
Move to root directory of target laravel project.
-
Run the commands below
- Install this library.
composer require zaxxas/laravel-simple-chat-notification.
- Publish config file.
php artisan vendor:publish --tag=laravel-simple-chat-notification
- Install this library.
-
Change source files below
- app/ServiceProviders/AppServiceProvider.php
'providers' => [ /* * Laravel Framework Service Providers... */ Illuminate\Auth\AuthServiceProvider::class, .... .... \Zaxxas\NotifyToChatTools\Providers\NotificationServiceProvider::class, // -> Add this line ], 'aliases' => Facade::defaultAliases()->merge([ .... 'InterventionImage' => Intervention\Image\Facades\Image::class, 'NotifyToChat' => Zaxxas\NotifyToChatTools\Facades\NotificationToChatToolFacade::class, // -> Add this line ])->toArray(), -
Add environment variables to .env file
variable content NOTIFICATION_TOOL* Target tool name. One from 'slack', 'teams', 'line' SLACK_WEBHOOK_URL Webhook url for slack notification SLACK_NOTIFICATION_CHANNEL Channel name for slack notification SLACK_NOTIFICATION_SENDAR_NAME Sendar name for slack notification TEAMS_WEBHOOK_URL Webhook url for Teams LINE_API_ENDPOINT Endpoint url for Line Notify API LINE_API_TOKEN Token for Line Notify API * : required
-
Add logic of notification (for example, like below.)
\NotifyToChat::notify( new NotificationMessageContent( title: 'sample title', message: 'sample message', keyValueFields: ['key1' => 'value1', 'key2' => 'value2'], ) );
zaxxas/laravel-simple-chat-notification 适用场景与选型建议
zaxxas/laravel-simple-chat-notification 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 259 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 zaxxas/laravel-simple-chat-notification 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zaxxas/laravel-simple-chat-notification 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 259
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-26