Skip to content

Commit

Permalink
Update HasSetting.php
Browse files Browse the repository at this point in the history
  • Loading branch information
SujalRatnaTamrakar authored May 22, 2024
1 parent d6ef469 commit dd5e58c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/HasSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ private function modifiedState(): array
$changes = [];

foreach ($newValues as $key => $newValue) {
$oldValues[$key] = $oldValues[$key] ?? '';
$oldValue = is_array($oldValues[$key]) ? json_encode($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>';
$changes[] = "- {$key} from <strong>".htmlspecialchars($oldValue).'</strong> to <strong>'.htmlspecialchars($newValue).'</strong>';
}
}

Expand Down

0 comments on commit dd5e58c

Please sign in to comment.