@php $report = $config['form']['navbar']['report']['input']; @endphp
| {{ __('field.' . $k) }} |
@if ($v['type'] == 'json')
@php
$jsonData = $data->{$k} ?? null;
$formattedJson = '-';
if ($jsonData) {
// Try to decode and re-encode with pretty print
$decoded = json_decode($jsonData, true);
if (json_last_error() === JSON_ERROR_NONE) {
$formattedJson = json_encode($decoded, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
} else {
// If it's not valid JSON, show as-is
$formattedJson = $jsonData;
}
}
@endphp
|
|---|