diff --git a/src/Support/Features.php b/src/Support/Features.php index 60614266..d98dfe7e 100644 --- a/src/Support/Features.php +++ b/src/Support/Features.php @@ -14,6 +14,7 @@ namespace Vanilo\Support; +use Vanilo\Contracts\Feature; use Vanilo\Support\Features\MultiChannel; use Vanilo\Support\Features\Pricing; @@ -23,6 +24,15 @@ class Features private static ?Pricing $pricing = null; + public static function findByName(string $name): ?Feature + { + return match ($name) { + 'pricing' => self::pricing(), + 'multichannel' => self::multichannel(), + default => null, + }; + } + public static function multichannel(): MultiChannel { return self::$multiChannel ?: (self::$multiChannel = new MultiChannel());