@@ -29,8 +29,9 @@ discard block |
||
29 | 29 | { |
30 | 30 | $decrypt = $this->decryptValue($value); |
31 | 31 | |
32 | - if (!is_array($decrypt) && $this->is_json($decrypt)) |
|
33 | - $decrypt = json_decode($decrypt); |
|
32 | + if (!is_array($decrypt) && $this->is_json($decrypt)) { |
|
33 | + $decrypt = json_decode($decrypt); |
|
34 | + } |
|
34 | 35 | |
35 | 36 | return $decrypt; |
36 | 37 | } |
@@ -94,8 +95,9 @@ discard block |
||
94 | 95 | { |
95 | 96 | $attributes = parent::attributesToArray(); |
96 | 97 | |
97 | - if (!config('encryption.encrypt')) |
|
98 | - return $attributes; |
|
98 | + if (!config('encryption.encrypt')) { |
|
99 | + return $attributes; |
|
100 | + } |
|
99 | 101 | |
100 | 102 | foreach ($this->encrypted ?? [] as $key) { |
101 | 103 | if (isset($attributes[$key])) { |