diff --git a/src/Database/ExpandoModel.php b/src/Database/ExpandoModel.php index 9edcddf71..2b51ce892 100644 --- a/src/Database/ExpandoModel.php +++ b/src/Database/ExpandoModel.php @@ -36,6 +36,17 @@ public function __construct(array $attributes = []) $this->addJsonable($this->expandoColumn); } + /** + * setExpandoAttributes on the model and protects the passthru values + */ + public function setExpandoAttributes(array $attributes = []) + { + $this->attributes = array_merge( + $this->attributes, + array_diff_key($attributes, array_flip($this->getExpandoPassthru())) + ); + } + /** * expandoAfterFetch constructor event */