Total Complexity | 6 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
7 | class AppSettings |
||
8 | { |
||
9 | public static function get($key, $default) { |
||
10 | $ret=Setting::where(['key' => $key])->first(); |
||
11 | if (blank($ret) || blank($ret->content)) { |
||
12 | return $default; |
||
13 | } |
||
14 | return $ret->is_json ? json_decode($ret->content) : $ret->content; |
||
15 | } |
||
16 | |||
17 | public static function set($key, $content) { |
||
29 | ]); |
||
30 | } |
||
32 |