mirror of
https://github.com/archtechx/virtualcolumn.git
synced 2025-12-12 15:34:04 +00:00
Check hasCast manually
This commit is contained in:
parent
85723fe337
commit
b0d5dad3fd
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ trait VirtualColumn
|
|||
$defaultEncryptedCastables = ['encrypted', 'encrypted:array', 'encrypted:collection', 'encrypted:json', 'encrypted:object'];
|
||||
|
||||
foreach ($model->getAttribute(static::getDataColumn()) ?? [] as $key => $value) {
|
||||
$keyHasEncryptedCastable = $model->hasCast($key, array_merge($defaultEncryptedCastables, static::$customEncryptedCastables));
|
||||
$keyHasEncryptedCastable = ! empty(array_intersect($model->getCasts(), array_merge($defaultEncryptedCastables, static::$customEncryptedCastables)));
|
||||
|
||||
if ($keyHasEncryptedCastable && static::valueEncrypted($value)) {
|
||||
$model->attributes[$key] = $value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue