mblsolutions / notifications
Laravel应用程序的通知包
v1.x-dev
2024-04-04 15:06 UTC
Requires
- php: ^7.4|^8.0|^8.1
- ext-json: *
- illuminate/contracts: ^6.0|^7.0|^8.0|^9.0|^10
- illuminate/events: ^6.0|^7.0|^8.0|^9.0|^10
- illuminate/support: ^6.0|^7.0|^8.0|^9.0|^10
- illuminate/testing: ^6.0|^7.0|^8.0|^9.0|^10
- sebbmeyer/php-microsoft-teams-connector: ^0.2.5
Requires (Dev)
- mockery/mockery: ~1.0
- orchestra/testbench: ^8.18
- phpunit/phpunit: ^7.3||^8.2||^9.3
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