| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 6 | public function get($key, $default = null) |
|
| 30 | { |
||
| 31 | 6 | $cache_key = static::cacheKey($key); |
|
| 32 | |||
| 33 | 6 | if (Cache::has($cache_key)) { |
|
| 34 | 4 | return Cache::get($cache_key); |
|
| 35 | } |
||
| 36 | |||
| 37 | 2 | $value = Setting::where('key', $key)->whereNull('owner_id')->pluck('value')->first(); |
|
| 38 | |||
| 39 | 2 | return $value ? $value : $default; |
|
| 40 | } |
||
| 41 | |||
| 54 |