@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function decryptAttribute($value) |
50 | 50 | { |
51 | - return $value ? $this->encrypter()->decrypt($value) : ''; |
|
51 | + return $value ? $this->encrypter()->decrypt($value) : ''; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |
@@ -36,7 +36,9 @@ |
||
36 | 36 | public function getKey() |
37 | 37 | { |
38 | 38 | if ($this->key === null) { |
39 | - if(! Config::get('encrypt.key')) throw new \Exception('The .env value ENCRYPT_KEY has to be set'); |
|
39 | + if(! Config::get('encrypt.key')) { |
|
40 | + throw new \Exception('The .env value ENCRYPT_KEY has to be set'); |
|
41 | + } |
|
40 | 42 | $this->key = substr(hash('sha256', Config::get('encrypt.key')), 0, 16); |
41 | 43 | } |
42 | 44 | return $this->key; |
@@ -95,8 +95,9 @@ |
||
95 | 95 | */ |
96 | 96 | public function guardClass($class) |
97 | 97 | { |
98 | - if (!class_exists($class)) |
|
99 | - throw new \Exception("Class {$class} does not exists"); |
|
98 | + if (!class_exists($class)) { |
|
99 | + throw new \Exception("Class {$class} does not exists"); |
|
100 | + } |
|
100 | 101 | $model = new $class(); |
101 | 102 | $this->validateHasEncryptedColumn($model); |
102 | 103 | return $model; |
@@ -95,8 +95,9 @@ |
||
95 | 95 | */ |
96 | 96 | public function guardClass($class) |
97 | 97 | { |
98 | - if (!class_exists($class)) |
|
99 | - throw new \Exception("Class {$class} does not exists"); |
|
98 | + if (!class_exists($class)) { |
|
99 | + throw new \Exception("Class {$class} does not exists"); |
|
100 | + } |
|
100 | 101 | $model = new $class(); |
101 | 102 | $this->validateHasEncryptedColumn($model); |
102 | 103 | return $model; |