Skip to content

Commit

Permalink
change how feature options are stored to work with config caching
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 13, 2020
1 parent 57d25e6 commit b243095
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

class Features
{
/**
* The options enabled for a given feature.
*
* @var array
*/
protected static $featureOptions = [];

/**
* Determine if the given feature is enabled.
*
Expand All @@ -34,7 +27,7 @@ public static function enabled(string $feature)
public static function optionEnabled(string $feature, string $option)
{
return static::enabled($feature) &&
Arr::get(static::$featureOptions, $feature.'.'.$option) === true;
config("fortify-options.{$feature}.{$option}") === true;
}

/**
Expand Down Expand Up @@ -139,7 +132,7 @@ public static function updatePasswords()
public static function twoFactorAuthentication(array $options = [])
{
if (! empty($options)) {
static::$featureOptions['two-factor-authentication'] = $options;
config(['fortify-options.two-factor-authentication' => $options]);
}

return 'two-factor-authentication';
Expand Down

0 comments on commit b243095

Please sign in to comment.