Configuration - teaminfinitydev/laravel-activity-log-discord GitHub Wiki
Discord Webhook Setup
- Go to your Discord server settings
- Navigate to Integrations → Webhooks
- Create a new webhook for your desired channel
- Copy the webhook URL
Environment Configuration
Add the following to your .env
file:
# Discord Configuration
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-url-here
DISCORD_BOT_NAME="App Activity Logger"
DISCORD_AVATAR_URL=https://your-app.com/logo.png
# Package Configuration
ACTIVITY_LOG_DISCORD_ENABLED=true
ACTIVITY_LOG_QUEUE=true
ACTIVITY_LOG_QUEUE_CONNECTION=default
ACTIVITY_LOG_QUEUE_NAME=discord-notifications
ACTIVITY_LOG_LEVEL=info
# Bootup Messages (Optional)
ACTIVITY_LOG_SEND_BOOTUP=false
SSL Configuration
By default, this package uses SSL verification when connecting to Discord webhooks. This is recommended for production environments.
For Production Environments (Default):
The package uses the following Guzzle configuration by default, which includes SSL verification:
$this->client = new Client([
'timeout' => 30,
'connect_timeout' => 10,
'verify' => true, // SSL verification enabled
]);
For Local Development or Troubleshooting:
If you're having connection issues in a local development environment or behind certain corporate firewalls, you may need to disable SSL verification temporarily:
- Open
src/Services/DiscordWebhookService.php
- Find the client initialization in the constructor
- Change the
verify
option tofalse
:
$this->client = new Client([
'timeout' => 30,
'connect_timeout' => 10,
'verify' => false, // SSL verification disabled
]);
⚠️ IMPORTANT SECURITY WARNING: Only disable SSL verification in local development environments. Never disable SSL verification in production as it makes your application vulnerable to man-in-the-middle attacks.
Test Your Integration
After configuration, test your webhook integration:
# Basic test
php artisan activity-log:test-webhook
# Detailed test with configuration info
php artisan activity-log:test-webhook --detailed