FEATURE: add getJson method to Settings helper
This commit is contained in:
@@ -45,6 +45,18 @@ class Settings
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for obtaining settings saved as JSON
|
||||
*
|
||||
* @param $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getJson($key)
|
||||
{
|
||||
return json_decode(self::get($key, '{}'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all settings
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user