Skip to content

Commit

Permalink
fix: Handling the case where the value is an array
Browse files Browse the repository at this point in the history
(cherry picked from commit b16ba4e)
  • Loading branch information
Chance-fyi committed Aug 29, 2023
1 parent 926f55c commit f0d67c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/orm/illuminate/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ public function getOldValue($model, string $key): string
$value = (method_exists($model, $attributeFun) ? $model->{$attributeFun}($model->getOriginal($key)) : $model->getOriginal($key));

if ($value instanceof ArrayObject) {
return json_encode($value->toArray(), JSON_UNESCAPED_UNICODE);
$value = $value->toArray();
}

if (is_array($value)) {
return json_encode($value, JSON_UNESCAPED_UNICODE);
}

$val = json_decode($value, true);
Expand Down

0 comments on commit f0d67c5

Please sign in to comment.