nikhilpatel8000 / laradiscordalerts
A Laravel package to send error logs to Discord
Requires
- php: >=8.0
- illuminate/support: ^10.0
This package is auto-updated.
Last update: 2025-08-17 04:19:58 UTC
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
.env
FileAdd your webhook URL to your
.env
file:DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-id
-
Set Log Channel
Update the
LOG_CHANNEL
in your.env
file: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.