@extends('layouts.portal') @section('title', 'Manage Will') @section('page_title', 'Will Management') @section('page_subtitle', 'View and manage your will details') @push('styles') @endpush @section('sidebar') @include('client.partials.sidebar', ['active' => 'will']) @endsection @section('content')

Will Management

ID: #{{ $will->id }} {{ ucfirst(str_replace('_', ' ', $will->status)) }}

Personal Information

First Name
{{ $client->first_name ?? 'Not provided' }}
Last Name
{{ $client->last_name ?? 'Not provided' }}
Email Address
{{ $client->email ?? 'Not provided' }}
Phone Number
{{ $client->phone ?? 'Not provided' }}
IC/Passport
{{ $client->ic_number ?? 'Not provided' }}
Date of Birth
{{ $client->dob ? date('d M Y', strtotime($client->dob)) : 'Not provided' }}
Occupation
{{ $client->occupation ?? 'Not provided' }}
Emergency Contact
{{ $client->emergency_contact_name ?? 'Not provided' }}
Emergency Phone
{{ $client->emergency_contact_phone ?? 'Not provided' }}
Address
{{ $client->address ?? 'Not provided' }}
Source of Funds
{{ $client->source_of_funds ?? 'Not provided' }}

Update History

@php $updates = []; if($will->updated_at) { $updates[] = [ 'timestamp' => $will->updated_at, 'action' => 'Will Updated', 'description' => 'Will document was modified', 'changed_by' => 'Client', 'icon' => 'fa-file-alt', 'color' => 'blue' ]; } if($client->familyMembers->count() > 0) { foreach($client->familyMembers as $member) { if($member->updated_at && $member->updated_at->greaterThan(now()->subDays(30))) { $updates[] = [ 'timestamp' => $member->updated_at, 'action' => 'Family Member Updated', 'description' => $member->full_name . ' (' . ucfirst($member->relationship) . ') information was updated', 'changed_by' => 'Client', 'icon' => 'fa-users', 'color' => 'green' ]; } } } if($client->assets->count() > 0) { foreach($client->assets as $asset) { if($asset->updated_at && $asset->updated_at->greaterThan(now()->subDays(30))) { $updates[] = [ 'timestamp' => $asset->updated_at, 'action' => 'Asset Updated', 'description' => $asset->description . ' (RM ' . number_format($asset->value, 2) . ')', 'changed_by' => 'Client', 'icon' => 'fa-coins', 'color' => 'purple' ]; } } } if($client->liabilities->count() > 0) { foreach($client->liabilities as $liability) { if($liability->updated_at && $liability->updated_at->greaterThan(now()->subDays(30))) { $updates[] = [ 'timestamp' => $liability->updated_at, 'action' => 'Liability Updated', 'description' => $liability->creditor . ' (RM ' . number_format($liability->amount, 2) . ')', 'changed_by' => 'Client', 'icon' => 'fa-credit-card', 'color' => 'red' ]; } } } $updates[] = [ 'timestamp' => $will->created_at, 'action' => 'Will Created', 'description' => 'Will document #' . $will->id . ' was created', 'changed_by' => 'System', 'icon' => 'fa-plus-circle', 'color' => 'gray' ]; usort($updates, function($a, $b) { return $b['timestamp']->getTimestamp() - $a['timestamp']->getTimestamp(); }); @endphp @if(count($updates) > 0)
@foreach($updates as $update)
{{ $update['action'] }}
{{ $update['description'] }}
{{ $update['timestamp']->format('M d, Y • H:i A') }} {{ $update['changed_by'] }}
@endforeach
@else

No updates recorded yet

@endif
@endsection