mirror of
https://github.com/archtechx/virtualcolumn.git
synced 2025-12-12 15:14:04 +00:00
Sync with original attributes
This commit is contained in:
parent
41d300bf7f
commit
2ae1ed099f
2 changed files with 5 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ trait VirtualColumn
|
|||
|
||||
foreach ($model->getAttribute(static::getDataColumn()) ?? [] as $key => $value) {
|
||||
$model->setAttribute($key, $value);
|
||||
$model->syncOriginalAttribute($key);
|
||||
}
|
||||
|
||||
$model->setAttribute(static::getDataColumn(), null);
|
||||
|
|
@ -52,6 +53,7 @@ trait VirtualColumn
|
|||
]));
|
||||
|
||||
unset($model->attributes[$key]);
|
||||
unset($model->original[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue