Add lnms commands to get and set config settings (#10534)

* add lnms commands to get and set config settings
lnms config:get and lnms config:set
Note: you cannot override settings in config.php

* Update to check setting exists and value validation rules.
This commit is contained in:
Tony Murray
2019-10-17 17:22:43 +00:00
committed by GitHub
parent 6c88436dce
commit 31dad0aaa7
8 changed files with 195 additions and 3 deletions

View File

@@ -297,6 +297,23 @@ class Config
}
}
/**
* Forget a key and all it's descendants from persistent storage.
* This will effectively set it back to default.
*
* @param string $key
* @return int|false
*/
public static function erase($key)
{
self::forget($key);
try {
return \App\Models\Config::withChildren($key)->delete();
} catch (\Exception $e) {
return false;
}
}
/**
* Check if a setting is set
*