Skip to content

Commit

Permalink
Fix abstract json cast format
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Aug 11, 2023
1 parent 110a6b1 commit 7ead3d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Support/EloquentCasts/DataEloquentCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]);
}

Expand Down

0 comments on commit 7ead3d8

Please sign in to comment.