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