Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public static function getValueFor($delimiter, $default = '') |
||
34 | { |
||
35 | $key = explode('.', $delimiter); |
||
36 | $group = $key[0]; |
||
37 | |||
38 | if (! isset($key[1])) { |
||
39 | throw new \InvalidArgumentException("There is no key provided!"); |
||
40 | } |
||
41 | $key = $key[1]; |
||
42 | |||
43 | return optional(self::where('key', $key)->where('group', $group)->first())->value ?? $default; |
||
44 | } |
||
45 | } |
||
46 |