@extends('layouts.portal') @section('title', 'All Wills') @section('page_title', 'All Wills') @section('page_subtitle', 'Manage will records') @section('sidebar') @endsection @section('content')

Will Management

Browse and manage all will records in the system

{{ $wills->count() }}
Total Wills
{{ $wills->where('status', 'pending_approval')->count() }}
Pending Approval
@if($wills->where('status', 'pending_approval')->count() > 0) @endif
{{ $wills->where('status', 'under_review')->count() }}
Under Review
{{ $wills->where('status', 'completed')->count() }}
Completed
@if($wills->count() > 0)
@foreach($wills as $document) @endforeach
Client Name Type Status Created By Created Updated Will ID Actions
@if($document->document_type === 'will') {{ $document->client ? substr($document->client->first_name, 0, 1) : '?' }} @else {{ $document->client ? substr($document->client->first_name, 0, 1) : substr($document->trust_creator['first_name'] ?? 'T', 0, 1) }} @endif
@if($document->document_type === 'will')

{{ $document->client ? $document->client->full_name : 'Unknown Client' }}

{{ $document->client ? $document->client->email : 'No email' }}

@else

@if($document->client) {{ $document->client->full_name }} @elseif($document->trust_creator && is_array($document->trust_creator)) {{ $document->trust_creator['first_name'] . ' ' . $document->trust_creator['last_name'] }} @else Unknown @endif

Trust: {{ $document->trust_name }}

@endif
@if($document->document_type === 'will') {{ $document->is_joint ? 'Joint Will' : ($document->will_type === 'individual' ? 'Individual Will' : 'Will') }} @if($document->is_joint) Joint @endif @else {{ $document->getTrustTypeLabel() }} @endif @if($document->document_type === 'will') {{ App\Models\Will::getStatuses()[$document->status] }} @else {{ ucfirst(str_replace('_', ' ', $document->status)) }} @endif @if($document->document_type === 'will') @if($document->created_by_type === 'agent') Agent: {{ $document->referredBy->name ?? 'Unknown' }} @else {{ $document->createdBy->name ?? 'System' }} @endif @else @if($document->created_by_type === 'agent') Agent: {{ $document->referredBy->name ?? 'Unknown' }} @elseif($document->created_by_type === 'lawyer') Lawyer: {{ $document->createdBy->name ?? 'Unknown' }} @else {{ $document->createdBy->name ?? 'System' }} @endif @endif @if($document->document_type === 'will') {{ $document->created_at->format('d M Y') }} @else {{ $document->creation_date ? \Carbon\Carbon::parse($document->creation_date)->format('d M Y') : $document->created_at->format('d M Y') }} @endif {{ $document->updated_at->format('d M Y H:i') }} @if($document->document_type === 'will') #{{ $document->id }} @else T{{ $document->id }} @endif
@if($document->document_type === 'trust') View Trust @else @if($document->status === 'pending_approval') Review @else View Will @endif @endif @if($document->version > 1) @if($document->document_type === 'trust') v{{ $document->version }} @else v{{ $document->version }} @endif @endif
{{ $wills->count() }} will(s) displayed
Pending: {{ $wills->where('status', 'pending_approval')->count() }}
Under Review: {{ $wills->where('status', 'under_review')->count() }}
Completed: {{ $wills->where('status', 'completed')->count() }}
{{ $wills->links() }}
@else

No Wills Found

There are no wills in the system yet, or none match your search criteria.

@endif @endsection