@extends('admin.layouts.app') @section('title', __('admin.logs.module_call_title', ['id' => $log->id])) @section('content') @php // Pretty-print JSON where it is JSON. Truehost rows hold a status line, // then Truehost's answer as received. $pretty = function (?string $text) { if ($text === null || $text === '') return null; $data = json_decode($text, true); if (is_array($data)) return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); $parts = explode("\n", $text, 2); $head = json_decode($parts[0], true); if (is_array($head) && isset($parts[1])) { $body = json_decode($parts[1], true); return json_encode($head, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)."\n\n" .($body !== null ? json_encode($body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) : $parts[1]); } return $text; }; $ok = $log->outcome(); @endphp
{{ $log->action }}{{ $pretty($log->{$field}) ?? '-' }}