'onWebhookRegistering', * ]; * * public function onWebhookRegistering(WebhookRegistering $event): void * { * $event->register('myapp.event.x', [ * 'payload' => [ * 'id' => 'string', * ], * ]); * } * ``` */ class WebhookRegistering extends LifecycleEvent { /** @var array> Collected webhook type definitions keyed by type */ protected array $types = []; /** * Register a webhook type definition. * * Later registrations with the same type replace earlier definitions so an * application can override defaults during boot. * * @param string $type Fully qualified webhook type name * @param array $definition Payload shape or metadata for the type */ public function register(string $type, array $definition = []): void { $this->types[$type] = $definition; } /** * Get all registered webhook type definitions. * * @return array> * * @internal Used by the webhook ingress bootstrap */ public function types(): array { return $this->types; } }