Skip to content

Commit

Permalink
fix null values for old_values and new_values (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
tminich authored Jul 23, 2024
1 parent 28ecd2d commit 9357577
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public function resolveData(): array
$this->metadata = array_keys($this->data);

// Modified Auditable attributes
foreach ($this->new_values as $key => $value) {
foreach ($this->new_values ?? [] as $key => $value) {
$this->data['new_' . $key] = $value;
}

foreach ($this->old_values as $key => $value) {
foreach ($this->old_values ?? [] as $key => $value) {
$this->data['old_' . $key] = $value;
}

Expand Down

0 comments on commit 9357577

Please sign in to comment.