@extends('layouts.portal') @section('title', 'Will Version History - ' . $will->client->full_name) @section('page_title', 'Will Version History') @section('page_subtitle', 'Track all updates to ' . $will->client->full_name . '\'s Will #' . $will->id) @section('sidebar') @include('admin.partials.sidebar', ['active' => 'wills']) @endsection @section('content')

Will Version History

Will ID: #{{ $will->id }} | {{ $will->client->full_name }} | v{{ $will->version ?? 1 }}

Back to Will

Current Version

{{ $will->version ?? 1 }}

Total Updates

{{ $versionHistory->count() }}

Last Updated

{{ $will->updated_at->format('M d, Y') }}

Updated By

{{ $currentVersion->getRoleLabel() ?? 'N/A' }}

Version Timeline

@if($versionHistory->count() > 0)
@foreach($versionHistory as $index => $version)
v{{ $version->version_number }}

Version {{ $version->version_number }} @if($index === 0) Current @endif

{{ $version->getRoleLabel() }}
@if($version->sections_json && is_array($version->sections_json) && count($version->sections_json) > 0)

Sections Updated:

@foreach($version->sections_json as $section) {{ ucfirst(str_replace('_', ' ', $section)) }} @endforeach
@endif @if($version->changes_summary)

Summary: {{ $version->changes_summary }}

@endif

Updated At

{{ $version->created_at->format('d M Y, g:i A') }}

Updated By

@if($version->updatedByUser)

{{ $version->updatedByUser->name ?? 'N/A' }}

@else

System

@endif

Status

{{ ucfirst($version->status) }}
@if($index > 0) @endif
@endforeach
@else

No version history available

@endif

Legend

👤 Client
🤝 Agent
⚖️ Lawyer
🔧 Admin
✓ Current
@endsection