| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | public static function set($key, $content) { |
||
| 18 | $ret=Setting::where(['key' => $key])->first(); |
||
| 19 | if (blank($ret)) { |
||
| 20 | return Setting::create([ |
||
| 21 | 'key' => $key, |
||
| 22 | 'content' => $content, |
||
| 23 | 'is_json' => false, |
||
| 24 | ]); |
||
| 25 | } |
||
| 26 | return Setting::find($ret->id)->update([ |
||
| 27 | 'content' => $content, |
||
| 28 | 'is_json' => false, |
||
| 29 | ]); |
||
| 32 |