neiderruiz / sentry-notification-laravel
将 Sentry 事件发送到 Slack
dev-master / 1.0.x-dev
2022-03-23 11:19 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- phpunit/phpunit: ^9.5.10
This package is auto-updated.
Last update: 2024-09-06 23:05:52 UTC
README
要求
安装包
composer require neiderruiz/sentry-notification-laravel
步骤
- [一] - 安装包
composer require neiderruiz/sentry-notification-laravel
- [二] - 注册提供者包,重定向到路由 config/app.php 内部提供者插入
//sentry notification Neiderruiz\SentryNotificationLaravel\Providers\SentryNotificationLaravelServiceProvider::class,
- [三] - 发布提供者
php artisan vendor:publish --provider="Neiderruiz\SentryNotificationLaravel\Providers\SentryNotificationLaravelServiceProvider"
- [四] - 创建表,在终端中运行命令
php artisan queue:table
- [六] - 运行迁移
php artisan migrate
- [七] - 配置环境变量
#sentry
SENTRY_LARAVEL_DSN=https://ba58cc597a7b4be1b0769052ef156fab@o1162423.ingest.sentry.io/6262441
SENTRY_TRACES_SAMPLE_RATE=1.0
SENTRY_SERVER_NAME=localhost
SENTRY_TOKEN=b2bd1fb414f4445a8f39c69961f26f97efcf780db2f24463a20e893ffe09e44f
SENTRY_URL_API=https://sentry.io/api/0/projects
SENTRY_ORGANIZATION=flash-swunschk
SENTRY_PROJECT=laravel-slack-dev-api
发送消息到 Slack
- [一] - 配置环境变量
#slack
SLACK_SEND_MESSAGE=true
SLACK_WEBHOOK_ENDPOINT=https://hooks.slack.com/services/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
运行命令 php artisan queue:table 环境变量 SENTRY_SLACK bool
许可证
MIT