diff --git a/src/SchemalessAttributes.php b/src/SchemalessAttributes.php index 26170ee..ee1391e 100644 --- a/src/SchemalessAttributes.php +++ b/src/SchemalessAttributes.php @@ -182,7 +182,9 @@ public function getIterator() protected function getRawSchemalessAttributes(): array { - return $this->model->fromJson($this->model->getAttributes()[$this->sourceAttributeName] ?? '{}'); + $attributes = $this->model->getAttributes()[$this->sourceAttributeName] ?? '{}'; + + return ($attributes =='""' ? [] : $this->model->fromJson($attributes)); } protected function override(iterable $collection)