Implement webhook inspector

This commit is contained in:
2026-08-04 17:09:39 +02:00
parent b021836c14
commit 75d8b25b64
57 changed files with 5110 additions and 230 deletions
+17
View File
@@ -0,0 +1,17 @@
<?php
use App\Models\User;
use App\Models\WebhookEndpoint;
use Illuminate\Support\Facades\Broadcast;
Broadcast::channel('App.Models.User.{id}', function (User $user, string $id): bool {
return (string) $user->getKey() === $id;
});
Broadcast::channel('webhooks.{endpointId}', function (User $user, string $endpointId): bool {
$endpoint = WebhookEndpoint::query()->find($endpointId);
return $endpoint instanceof WebhookEndpoint
&& ! $endpoint->is_public
&& (string) $endpoint->user_id === (string) $user->getKey();
});