Skip to content

Commit

Permalink
Merge pull request #26 from henryavila/main
Browse files Browse the repository at this point in the history
Fix error when model column is array
  • Loading branch information
199ocero authored May 2, 2024
2 parents ac672ae + afa8688 commit 534da97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Concerns/HasSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ private function modifiedState(): array
$oldValues[$key] = $oldValues[$key] ?? '';
$newValue = $newValue ?? '';

if (is_array($newValue)) {
$newValue = json_encode($newValue);
}

if (isset($oldValues[$key]) && $oldValues[$key] != $newValue) {
$changes[] = "- {$key} from <strong>".htmlspecialchars($oldValues[$key]).'</strong> to <strong>'.htmlspecialchars($newValue).'</strong>';
}
Expand Down

0 comments on commit 534da97

Please sign in to comment.