-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the search engine and inventory feature configuration wrappers
- Loading branch information
1 parent
e45d3d4
commit 50c0029
Showing
5 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Contains the Inventory class. | ||
* | ||
* @copyright Copyright (c) 2024 Vanilo UG | ||
* @author Attila Fulop | ||
* @license MIT | ||
* @since 2024-10-18 | ||
* | ||
*/ | ||
|
||
namespace Vanilo\Support\Features; | ||
|
||
use Vanilo\Contracts\Feature; | ||
|
||
class Inventory implements Feature | ||
{ | ||
public function isEnabled(): bool | ||
{ | ||
return config('vanilo.features.pricing.inventory', false) | ||
&& null !== concord()->module('inventory'); | ||
} | ||
|
||
public function isDisabled(): bool | ||
{ | ||
return !$this->isEnabled(); | ||
} | ||
|
||
public function configuration(): array | ||
{ | ||
return config('vanilo.features.inventory', []); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Contains the SearchEngine class. | ||
* | ||
* @copyright Copyright (c) 2024 Vanilo UG | ||
* @author Attila Fulop | ||
* @license MIT | ||
* @since 2024-10-18 | ||
* | ||
*/ | ||
|
||
namespace Vanilo\Support\Features; | ||
|
||
use Vanilo\Contracts\Feature; | ||
|
||
class SearchEngine implements Feature | ||
{ | ||
public function isEnabled(): bool | ||
{ | ||
return config('vanilo.features.pricing.search_engine', false) | ||
&& null !== concord()->module('search'); | ||
} | ||
|
||
public function isDisabled(): bool | ||
{ | ||
return !$this->isEnabled(); | ||
} | ||
|
||
public function configuration(): array | ||
{ | ||
return config('vanilo.features.search_engine', []); | ||
} | ||
} |