From b62feae26723a97c6e1ba7c3131dc50a4a48e958 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:44:45 +0200 Subject: [PATCH] Moved the `Features` functionality from Foundation to Support --- Changelog.md | 1 + Features.php | 55 +++++++++++++++++++++++++++++++++++++++ Features/MultiChannel.php | 35 +++++++++++++++++++++++++ Features/Pricing.php | 36 +++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 Features.php create mode 100644 Features/MultiChannel.php create mode 100644 Features/Pricing.php diff --git a/Changelog.md b/Changelog.md index 22b165d..17b6735 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,7 @@ - Dropped PHP 8.0 & PHP 8.1 Support - Dropped Laravel 9 Support +- Added the `Features` accessor class, which is a syntactic sugar for areas of the configuration ## 3.x Series diff --git a/Features.php b/Features.php new file mode 100644 index 0000000..6061426 --- /dev/null +++ b/Features.php @@ -0,0 +1,55 @@ +isEnabled(); + } + + public static function isMultiChannelDisabled(): bool + { + return self::multichannel()->isDisabled(); + } + + public static function isPricingEnabled(): bool + { + return self::pricing()->isEnabled(); + } + + public static function isPricingDisabled(): bool + { + return self::pricing()->isDisabled(); + } +} diff --git a/Features/MultiChannel.php b/Features/MultiChannel.php new file mode 100644 index 0000000..1f630d8 --- /dev/null +++ b/Features/MultiChannel.php @@ -0,0 +1,35 @@ +isEnabled(); + } + + public function configuration(): array + { + return config('vanilo.foundation.features.multi_channel', []); + } +} diff --git a/Features/Pricing.php b/Features/Pricing.php new file mode 100644 index 0000000..9a7fcf3 --- /dev/null +++ b/Features/Pricing.php @@ -0,0 +1,36 @@ +module('vanilo.pricing'); + } + + public function isDisabled(): bool + { + return !$this->isEnabled(); + } + + public function configuration(): array + { + return config('vanilo.foundation.features.pricing', []); + } +}