@php /** @var \App\Models\Revision $revision */ $render = function ($value): string { if ($value === null || $value === '') { return '—'; } return is_scalar($value) ? (string) $value : json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); }; @endphp {{-- Old beside new, field by field. Reading the difference is the point: "changed the Catalan title" is useful, "saved the page" is not. --}}
@forelse ($revision->fields() as $field) @php($diff = $revision->diff($field))

{{ $field }}

{{ __('panel.revisions.before') }}

{{ $render($diff['old']) }}

{{ __('panel.revisions.after') }}

{{ $render($diff['new']) }}
@empty

{{ __('panel.revisions.no_changes') }}

@endforelse