master
cody 8 months ago
parent 0b6bcdba06
commit 72ccf05e8c

@ -14,9 +14,7 @@ class Config extends SoftDeletesModel
*/ */
public static function getValueByKey($key) public static function getValueByKey($key)
{ {
$config = Cache::remember('config_array', 300, function () { $config = self::pluck('value', 'key')->toArray();
return self::pluck('value', 'key')->toArray();
});
if (isset($config[$key])) { if (isset($config[$key])) {
return $config[$key]; return $config[$key];
} }

Loading…
Cancel
Save