Skip to content

Commit

Permalink
Encode objects when casting as JSON (#37759)
Browse files Browse the repository at this point in the history
  • Loading branch information
halloei authored Jun 21, 2021
1 parent 21df721 commit ad15cf5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function castAsJson($value)
{
if ($value instanceof Jsonable) {
$value = $value->toJson();
} elseif (is_array($value)) {
} elseif (is_array($value) || is_object($value)) {
$value = json_encode($value);
}

Expand Down

0 comments on commit ad15cf5

Please sign in to comment.