coolify/app/Notifications/Channels/WebhookChannel.php
Andras Bacsai dc15bee980 feat: implement actual webhook delivery with Ray debugging
Added actual HTTP POST delivery for webhook notifications and comprehensive Ray debugging for development.

Changes:
- Updated Team model to implement SendsWebhook interface
- Added routeNotificationForWebhook() method to Team
- Enhanced SendWebhookJob with Ray logging for request/response
- Added Ray debugging to WebhookChannel for dispatch tracking
- Added Ray debugging to Webhook Livewire component

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 18:07:04 +02:00

37 lines
1,010 B
PHP

<?php
namespace App\Notifications\Channels;
use App\Jobs\SendWebhookJob;
use Illuminate\Notifications\Notification;
class WebhookChannel
{
/**
* Send the given notification.
*/
public function send(SendsWebhook $notifiable, Notification $notification): void
{
$webhookSettings = $notifiable->webhookNotificationSettings;
if (! $webhookSettings || ! $webhookSettings->isEnabled() || ! $webhookSettings->webhook_url) {
if (isDev()) {
ray('Webhook notification skipped - not enabled or no URL configured');
}
return;
}
$payload = $notification->toWebhook();
if (isDev()) {
ray('Dispatching webhook notification', [
'notification' => get_class($notification),
'url' => $webhookSettings->webhook_url,
'payload' => $payload,
]);
}
SendWebhookJob::dispatch($payload, $webhookSettings->webhook_url);
}
}