authorizeCurrentWorkspace( $request, 'manageWebhooks', 'Not authorized to manage webhooks.', ); if (! $workspace instanceof Workspace) { return $workspace; } $validated = $request->validate(ReplayWebhookLogRequest::rules()); $webhook = $this->webhookInWorkspace($workspace, data_get($validated, 'webhook_id')); if (! $webhook instanceof Webhook) { return $webhook; } $log = $this->webhookLogFor($webhook, data_get($validated, 'log_id')); if (! $log instanceof WebhookLog) { return $log; } ReplayWebhookLog::execute($webhook, $log); return Response::structured(['replayed' => true]); } /** * @return array */ public function schema(JsonSchema $schema): array { return [ 'webhook_id' => $schema->string()->required()->description('The webhook ID.'), 'log_id' => $schema->string()->required()->description('The delivery log ID to replay.'), ]; } }