From 7ead3d8f761846185a94d06e584bfe17e43b9239 Mon Sep 17 00:00:00 2001 From: Ruben Van Assche Date: Fri, 11 Aug 2023 13:59:07 +0200 Subject: [PATCH] Fix abstract json cast format --- src/Support/EloquentCasts/DataEloquentCast.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Support/EloquentCasts/DataEloquentCast.php b/src/Support/EloquentCasts/DataEloquentCast.php index 4dc5bf17..bc14fb5f 100644 --- a/src/Support/EloquentCasts/DataEloquentCast.php +++ b/src/Support/EloquentCasts/DataEloquentCast.php @@ -66,7 +66,7 @@ public function set($model, string $key, $value, array $attributes): ?string if ($isAbstractClassCast) { return json_encode([ 'type' => $this->dataConfig->morphMap->getDataClassAlias($value::class) ?? $value::class, - 'data' => $value->toJson(), + 'data' => json_decode($value->toJson(), associative: true, flags: JSON_THROW_ON_ERROR), ]); }