authorizeCurrentWorkspace( $request, 'manageWebhooks', 'Not authorized to manage webhooks.', ); if (! $workspace instanceof Workspace) { return $workspace; } $validated = $request->validate(WebhookIdRequest::rules()); $webhook = $this->webhookInWorkspace($workspace, data_get($validated, 'webhook_id')); if (! $webhook instanceof Webhook) { return $webhook; } return Response::structured( (new WebhookResource($webhook->makeVisible('signing_secret')))->resolve(), ); } /** * @return array */ public function schema(JsonSchema $schema): array { return [ 'webhook_id' => $schema->string()->required()->description('The webhook ID.'), ]; } }