mblsolutions/notifications

Laravel应用程序的通知包

v1.x-dev 2024-04-04 15:06 UTC

This package is auto-updated.

Last update: 2024-09-04 15:59:14 UTC


README

此包用于通过多个渠道发送消息。目前实现了以下功能:Microsoft Teams、邮件、日志文件

安装

推荐通过 Composer 安装 Inspired Deck Laravel。

composer require mblsolutions/notifications

Laravel 无自动发现

如果您不使用自动发现,请将 ServiceProvider 添加到 config/app.php 文件中的 providers 数组中

\MBLSolutions\Notifications\NotificationsServiceProvider::class,

用法

使用 publish 命令将包配置复制到您的本地配置

php artisan vendor:publish --provider="MBLSolutions\Notifications\NotificationsServiceProvider"

config/notifications.php 中将可看到一个新配置文件。

配置使用合理的默认值,但您可以通过 .env 变量进行更改

NOTIFICATIONS_CHANNEL=stack # Options: stack, log, teams, mail
NOTIFICATIONS_LOG_CHANNEL=single # This should be one of the options in config('logging.channels')
NOTIFICATIONS_TEAMS_WEBHOOK_URL= # You must set this up via following this guide: https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-outgoing-webhook
NOTIFICATIONS_MAILER=smtp # This should be one of the options in config('mail.mailers')
NOTIFICATIONS_MAIL_FROM_ADDRESS= # The default from mail address
NOTIFICATIONS_MAIL_FROM_NAME= # The default from mail name
NOTIFICATIONS_MAIL_TO_ADDRESS= # The default to mail address
NOTIFICATIONS_MAIL_TO_NAME= # The default to mail name