diff --git a/app/Traits/EncodeUTF8.php b/app/Traits/EncodeUTF8.php index 2b83413..5881e4c 100644 --- a/app/Traits/EncodeUTF8.php +++ b/app/Traits/EncodeUTF8.php @@ -82,8 +82,11 @@ trait EncodeUTF8 public function getAttribute($key) { if (in_array($key,self::cast_utf8) && Arr::get($this->attributes,$key) && (! Arr::get($this->_encoded,$key))) { - $this->attributes[$key] = utf8_decode($this->attributes[$key]); + // We need to get it from the parent first, taking into account any casting + $this->attributes[$key] = utf8_decode(parent::getAttribute($key)); $this->_encoded[$key] = TRUE; + + return $this->attributes[$key]; } return parent::getAttribute($key);