@extends('layouts.portal') @section('title', 'Will Version Changes Report') @section('page_title', 'Will Version Changes Report') @section('page_subtitle', 'Track all changes made to wills') @section('sidebar') @include('admin.partials.sidebar', ['active' => 'will-changes-report']) @endsection @section('content')

Track all changes made to wills, including version history, timestamps, and who made changes

Reset
Total Wills Tracked

{{ $totalWills }}

Total Versions

{{ $totalVersions }}

Avg Versions/Will

{{ number_format($avgVersionsPerWill, 1) }}

Last 24hrs Changes

{{ $last24hrsChanges }}

Will Version Changes
@forelse($willChanges as $change) @empty @endforelse
Will ID Client Versions Last Updated Last Changed By Payment Status Paid Date Actions
#{{ $change['will_id'] }}

{{ $change['client_name'] }}

{{ $change['client_email'] }}
v{{ $change['current_version'] }} @if($change['version_count'] > 1) ({{ $change['version_count'] }} total) @endif

{{ $change['last_updated'] ? \Carbon\Carbon::parse($change['last_updated'])->format('d M Y') : 'N/A' }}

{{ $change['last_updated'] ? \Carbon\Carbon::parse($change['last_updated'])->format('g:i A') : 'N/A' }}
@php $roleColors = [ 'client' => ['bg' => 'bg-purple-100', 'text' => 'text-purple-800'], 'agent' => ['bg' => 'bg-green-100', 'text' => 'text-green-800'], 'lawyer' => ['bg' => 'bg-blue-100', 'text' => 'text-blue-800'], 'admin' => ['bg' => 'bg-red-100', 'text' => 'text-red-800'], ]; $colors = $roleColors[$change['updated_by_type']] ?? ['bg' => 'bg-gray-100', 'text' => 'text-gray-800']; @endphp {{ ucfirst($change['updated_by_type']) }} {{ ucfirst($change['payment_status'] ?? 'N/A') }} {{ $change['paid_date'] ? \Carbon\Carbon::parse($change['paid_date'])->format('d M Y') : 'N/A' }} History
No will changes found
Recent Version Changes (Last 50)
@forelse($recentVersions as $version) @empty @endforelse
Will Version Sections Changed Changed By Date & Time Details
#{{ $version['will_id'] }} v{{ $version['version_number'] }}
@foreach($version['sections_updated'] ?? [] as $section) {{ ucfirst(str_replace('_', ' ', $section)) }} @endforeach
@php $roleColors = [ 'client' => ['bg' => 'bg-purple-100', 'text' => 'text-purple-800'], 'agent' => ['bg' => 'bg-green-100', 'text' => 'text-green-800'], 'lawyer' => ['bg' => 'bg-blue-100', 'text' => 'text-blue-800'], 'admin' => ['bg' => 'bg-red-100', 'text' => 'text-red-800'], 'staff' => ['bg' => 'bg-gray-100', 'text' => 'text-gray-800'], ]; $colors = $roleColors[$version['role']] ?? ['bg' => 'bg-gray-100', 'text' => 'text-gray-800']; @endphp
{{ ucfirst($version['role'] ?? 'Unknown') }}

{{ $version['user_name'] ?? 'N/A' }}

{{ \Carbon\Carbon::parse($version['created_at'])->format('d M Y') }}

{{ \Carbon\Carbon::parse($version['created_at'])->format('g:i A') }}
View
No recent version changes
@endsection