Skip to content

Commit

Permalink
Fix: Encode json if array
Browse files Browse the repository at this point in the history
  • Loading branch information
clevyr-anthony committed Nov 4, 2024
1 parent b5a6ae2 commit 44fdf29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/Models/PageSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public function getFormattedDataAttribute()

foreach ($data as $key => $d) {
if (is_array($d)) {
$data[$key] = $d;
} else {
$data[$key] = json_decode($d, true) ?? $d;
$d = json_encode($d);
}

$data[$key] = json_decode($d, true) ?? $d;
}

return $data;
Expand Down

0 comments on commit 44fdf29

Please sign in to comment.