Skip to content

Commit

Permalink
更新名称
Browse files Browse the repository at this point in the history
  • Loading branch information
Joycezhangw committed Feb 13, 2022
1 parent 62a5140 commit 6e6c6e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Traits/EncryptTableDbAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trait EncryptTableDbAttribute
*/
public function setAttribute($key, $value)
{
if (is_null($value) || !in_array($key, $this->encryptable)) {
if (is_null($value) || !in_array($key, $this->encryptTable)) {
return parent::setAttribute($key, $value);
}
if ($this->isJsonCastable($key) && !is_null($value)) {
Expand Down Expand Up @@ -47,7 +47,7 @@ public function getAttributeValue($key)
}

// 在强制转换前解密
if (in_array($key, $this->encryptable) && !is_null($value) && $value !== '') {
if (in_array($key, $this->encryptTable) && !is_null($value) && $value !== '') {
$value = $this->decrypt($value);
}

Expand Down Expand Up @@ -115,7 +115,7 @@ public function attributesToArray(): array
private function decryptAttributes(array $attributes): array
{
foreach ($attributes as $key => $value) {
if (!in_array($key, $this->encryptable) || is_null($value) || $value === '') {
if (!in_array($key, $this->encryptTable) || is_null($value) || $value === '') {
continue;
}

Expand Down

0 comments on commit 6e6c6e1

Please sign in to comment.