nikhilpatel8000/laradiscordalerts
Composer 安装命令:
composer require nikhilpatel8000/laradiscordalerts
包简介
A Laravel package to send error logs to Discord
README 文档
README
LaraDiscordAlerts is a Laravel package that automatically sends application error logs to a specified Discord channel. This helps developers monitor and debug errors in real-time.
Features
- Sends Laravel application errors to a Discord channel.
- Easy to configure with a webhook URL.
- Supports different log levels.
- Lightweight and efficient.
Installation
You can install the package via Composer:
composer require nikhilpatel8000/laradiscordalerts
Configuration
Publish Configuration File
After installation, publish the configuration file using:
php artisan vendor:publish --tag=laradiscordalerts-config
This will create a config/laradiscordalerts.php file.
Set Up Discord Webhook
-
Create a Discord Webhook
- Go to your Discord Server → Server Settings → Integrations → Webhooks.
- Click New Webhook, name it, and copy the Webhook URL.
-
Update
.envFileAdd your webhook URL to your
.envfile:DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-id
-
Set Log Channel
Update the
LOG_CHANNELin your.envfile:LOG_CHANNEL=discord
Usage
Once configured, any application error logs will be automatically sent to the specified Discord channel.
Testing
You can test the logging by running:
Log::error('This is a test error message');
If configured correctly, this message will appear in your Discord channel.
Uninstallation
To remove the package, run:
composer remove nikhilpatel8000/laradiscordalerts
License
This package is open-source and released under the MIT License.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-17