From: Vincent Vanwaelscappel Date: Wed, 14 Oct 2020 12:06:58 +0000 (+0200) Subject: wait #3947 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=51d2fc6033bf4233d9fac7173bec9b1d0934a599;p=cubist_cms-back.git wait #3947 --- diff --git a/src/app/Magic/Models/CubistMagicAbstractModel.php b/src/app/Magic/Models/CubistMagicAbstractModel.php index f48f317..949cb97 100644 --- a/src/app/Magic/Models/CubistMagicAbstractModel.php +++ b/src/app/Magic/Models/CubistMagicAbstractModel.php @@ -18,6 +18,7 @@ use Doctrine\DBAL\Schema\Table; use GeneaLabs\LaravelModelCaching\Traits\Cachable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; use Illuminate\Support\Str; use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; @@ -498,7 +499,12 @@ class CubistMagicAbstractModel extends Model implements HasMedia $res = new PageData(); $res->setEntity($this); foreach ($this->attributes as $key => $value) { - $res->set($key, Json::decodeRecursive($this->getAttributeValue($key), Json::TYPE_ARRAY)); + $v = $this->getAttributeValue($key); + if ($v instanceof Carbon) { + $res->set($key, $v); + continue; + } + $res->set($key, Json::decodeRecursive($v, Json::TYPE_ARRAY)); } return $res; }