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>
37 lines
1,010 B
PHP
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);
|
|
}
|
|
}
|