integrations[$slug] = array_merge([ 'slug' => $slug, 'icon' => 'integration', 'description' => '', 'requiresAuth' => false, 'settingsSchema' => [], 'plan' => 'lite', // 'lite', 'essentials', 'growth', 'agency' 'learnMoreUrl' => '', // Optional documentation/learn more URL ], $config); } /** * Get all registered integrations * * @return mixed[] */ public function getAll(): array { return $this->integrations; } /** * Get a specific integration by slug * * @param string $slug * @return mixed[]|null */ public function get(string $slug): ?array { return $this->integrations[$slug] ?? null; } /** * Check if an integration is registered * * @param string $slug * @return bool */ public function has(string $slug): bool { return isset($this->integrations[$slug]); } /** * Get integrations by plan * * @param string|mixed[] $plans Plan name(s) to filter by * @return mixed[] */ public function getByPlan($plans): array { $plans = (array) $plans; return array_filter($this->integrations, function ($integration) use ($plans) { return in_array($integration['plan'], $plans); }); } /** * Unregister an integration * * @param string $slug * @return void */ public function unregister(string $slug): void { unset($this->integrations[$slug]); } }