mirror of
https://github.com/archtechx/virtualcolumn.git
synced 2025-12-12 18:44:04 +00:00
Handle encrypted columns which are set to null (#19)
* 🧪 Add a test for a null value * 🐛 Don't consider null types for decryption
This commit is contained in:
parent
7371aac2ab
commit
65f9000328
2 changed files with 7 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ trait VirtualColumn
|
|||
foreach ($this->getAttribute(static::getDataColumn()) ?? [] as $key => $value) {
|
||||
$attributeHasEncryptedCastable = in_array(data_get($this->getCasts(), $key), $encryptedCastables);
|
||||
|
||||
if ($attributeHasEncryptedCastable && $this->valueEncrypted($value)) {
|
||||
if ($value && $attributeHasEncryptedCastable && $this->valueEncrypted($value)) {
|
||||
$this->attributes[$key] = $value;
|
||||
} else {
|
||||
$this->setAttribute($key, $value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue