From 85bbc384a7da702e27313ca302ede85a3b8b9421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Sun, 25 Sep 2016 01:35:52 +0200 Subject: [PATCH] FEATURE: add getJson method to Settings helper --- app/Helpers/Settings.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Helpers/Settings.php b/app/Helpers/Settings.php index cac5e30d..56882328 100644 --- a/app/Helpers/Settings.php +++ b/app/Helpers/Settings.php @@ -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 *