app->singleton(self::WEBHOOK_TYPES, static fn (): array => []); } public function boot(): void { $this->app->booted(function (): void { $this->app->instance(self::WEBHOOK_TYPES, static::fireWebhookRegistering()); }); } /** * Fire WebhookRegistering and return the collected type registry. * * @return array> */ public static function fireWebhookRegistering(): array { $event = new WebhookRegistering; event($event); return $event->types(); } /** * Get the webhook type registry captured during boot. * * @return array> */ public static function webhookTypes(): array { return app()->bound(self::WEBHOOK_TYPES) ? app(self::WEBHOOK_TYPES) : []; } }