Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Fix json serializing models
Browse files Browse the repository at this point in the history
- Closes #430
  • Loading branch information
stevebauman committed Aug 3, 2017
1 parent 7db8896 commit d207376
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ public function offsetUnset($offset)
*/
public function jsonSerialize()
{
// We need to remove the object SID and GUID from
// being serialized as these attributes contain
// characters that cannot be serialized.
return Arr::except($this->getAttributes(), [
$this->schema->objectSid(),
$this->schema->objectGuid(),
]);
$attributes = $this->getAttributes();

array_walk_recursive($attributes, function(&$val){
$val = utf8_encode($val);
});

return $attributes;
}

/**
Expand Down

0 comments on commit d207376

Please sign in to comment.