@extends('layouts.portal') @section('title', 'Complete Trust Summary') @section('page_title', 'Complete Trust Summary') @section('page_subtitle', 'View all trust information') @section('sidebar') @include('client.partials.onboarding-sidebar', ['step' => 1]) @endsection @push('styles') @include('components.form-styles') @endpush @section('content')

Trust Information

Trust Name

{{ $trust->trust_name ?? 'N/A' }}

Trust Type

{{ str_replace('_', ' ', $trust->trust_type ?? 'N/A') }}

Status

{{ ucfirst(str_replace('_', ' ', $trust->status ?? 'N/A')) }}

Created

{{ $trust->created_at ? $trust->created_at->format('d M Y') : 'N/A' }}

Trust Purpose: {{ $trust->trust_purpose ?? 'N/A' }}
Trust Code: {{ $trust->trust_code ?? 'N/A' }}
@php $trustCreatorDetails = is_string($trust->trust_creator) ? json_decode($trust->trust_creator, true) ?? [] : ($trust->trust_creator ?? []); $trustCreatorName = $trustCreatorDetails['full_name'] ?? $trustCreatorDetails['name'] ?? $trust->client->full_name ?? 'N/A'; $trustCreatorIC = $trustCreatorDetails['ic'] ?? $trustCreatorDetails['ic_number'] ?? $trust->client->ic_number ?? 'N/A'; $trustCreatorAddress = $trustCreatorDetails['address'] ?? $trust->client->address ?? 'N/A'; @endphp

Settlor Information

Full Name: {{ strtoupper($trustCreatorName) }}
NRIC/Passport: {{ $trustCreatorIC }}
Address: {{ $trustCreatorAddress }}
@php $trustees = $trust->trustees->map(fn($t) => ['full_name' => $t->full_name, 'ic' => $t->ic_or_reg_no, 'address' => $t->address, 'phone' => $t->phone])->toArray(); @endphp

Trustees ({{ count($trustees) }})

@if(count($trustees) > 0)
@foreach($trustees as $trustee) @endforeach
Name NRIC/Passport Address Contact
{{ strtoupper($trustee['full_name'] ?? 'N/A') }} {{ $trustee['ic'] ?? 'N/A' }} {{ $trustee['address'] ?? 'N/A' }} {{ $trustee['phone'] ?? 'N/A' }}
@else

No trustees recorded.

@endif
@php $beneficiaries = $trust->beneficiaries->map(fn($b) => ['full_name' => $b->full_name, 'type' => $b->beneficiary_type, 'ic' => $b->ic_or_reg_no, 'phone' => $b->phone])->toArray(); @endphp

Beneficiaries ({{ count($beneficiaries) }})

@if(count($beneficiaries) > 0)
@foreach($beneficiaries as $beneficiary) @endforeach
Full Name Type NRIC/Passport Contact
{{ strtoupper($beneficiary['full_name'] ?? 'N/A') }} {{ str_replace('_', ' ', ucfirst($beneficiary['type'] ?? 'N/A')) }} {{ $beneficiary['ic'] ?? 'N/A' }} {{ $beneficiary['phone'] ?? 'N/A' }}
@else

No beneficiaries recorded.

@endif
@php $assets = $trust->assets->map(fn($a) => ['description' => $a->description, 'category' => $a->asset_category, 'value' => $a->current_value])->toArray(); $totalAssetValue = collect($assets)->sum('value'); @endphp

Trust Assets ({{ count($assets) }})

@if(count($assets) > 0)
@foreach($assets as $asset) @endforeach
Description Category Value (RM)
{{ $asset['description'] ?? 'N/A' }} {{ str_replace('_', ' ', ucfirst($asset['category'] ?? 'N/A')) }} RM {{ number_format($asset['value'] ?? 0, 2) }}

Total Trust Asset Value: RM {{ number_format($totalAssetValue, 2) }}

@else

No assets recorded.

@endif
@php $allowances = $trust->allowances->map(fn($a) => ['beneficiary' => $a->beneficiary_name, 'amount' => $a->monthly_amount, 'frequency' => $a->frequency, 'start_date' => $a->start_date])->toArray(); @endphp @if(count($allowances) > 0)

Allowances & Distributions ({{ count($allowances) }})

@foreach($allowances as $allowance) @endforeach
Beneficiary Amount (RM) Frequency Start Date
{{ $allowance['beneficiary'] ?? 'N/A' }} RM {{ number_format($allowance['amount'] ?? 0, 2) }} {{ ucfirst($allowance['frequency'] ?? 'N/A') }} {{ isset($allowance['start_date']) ? date('M d, Y', strtotime($allowance['start_date'])) : 'N/A' }}
@endif @php $gifts = $trust->gifts->map(fn($g) => ['description' => $g->description, 'value' => $g->value])->toArray(); @endphp @if(count($gifts) > 0)

Gifts & Bequests ({{ count($gifts) }})

@foreach($gifts as $gift) @endforeach
Description Value (RM)
{{ $gift['description'] ?? 'N/A' }} RM {{ number_format($gift['value'] ?? 0, 2) }}
@endif @php $caretakers = $trust->caretakers->map(fn($c) => ['full_name' => $c->full_name, 'role' => $c->role, 'ic' => $c->ic_or_reg_no, 'phone' => $c->phone])->toArray(); @endphp @if(count($caretakers) > 0)

Caretakers ({{ count($caretakers) }})

@foreach($caretakers as $caretaker) @endforeach
Full Name Role NRIC/Passport Contact
{{ strtoupper($caretaker['full_name'] ?? 'N/A') }} {{ ucfirst($caretaker['role'] ?? 'N/A') }} {{ $caretaker['ic'] ?? 'N/A' }} {{ $caretaker['phone'] ?? 'N/A' }}
@endif @php $guardianAllowances = $trust->guardianAllowances->map(fn($ga) => ['name' => $ga->name, 'amount' => $ga->monthly_amount, 'frequency' => $ga->frequency, 'start_date' => $ga->start_date])->toArray(); @endphp @if(count($guardianAllowances) > 0)

Guardian & Caretaker Allowances ({{ count($guardianAllowances) }})

@foreach($guardianAllowances as $allowance) @endforeach
Name Amount (RM) Frequency Start Date
{{ $allowance['name'] ?? 'N/A' }} RM {{ number_format($allowance['amount'] ?? 0, 2) }} {{ ucfirst($allowance['frequency'] ?? 'N/A') }} {{ isset($allowance['start_date']) ? date('M d, Y', strtotime($allowance['start_date'])) : 'N/A' }}
@endif @php $administratorAllowances = $trust->administratorAllowances->map(fn($aa) => ['name' => $aa->name, 'amount' => $aa->monthly_amount, 'frequency' => $aa->frequency])->toArray(); @endphp @if(count($administratorAllowances) > 0)

Administrator Allowances ({{ count($administratorAllowances) }})

@foreach($administratorAllowances as $allowance) @endforeach
Administrator Amount (RM) Frequency
{{ $allowance['name'] ?? 'N/A' }} RM {{ number_format($allowance['amount'] ?? 0, 2) }} {{ ucfirst($allowance['frequency'] ?? 'N/A') }}
@endif @php $donations = $trust->donations->map(fn($d) => ['organization' => $d->organization_name, 'amount' => $d->donation_amount, 'purpose' => $d->donation_purpose])->toArray(); @endphp @if(count($donations) > 0)

Charitable Donations ({{ count($donations) }})

@foreach($donations as $donation) @endforeach
Organization Amount (RM) Purpose
{{ $donation['organization'] ?? 'N/A' }} RM {{ number_format($donation['amount'] ?? 0, 2) }} {{ $donation['purpose'] ?? 'N/A' }}
@endif
Back to Dashboard
@endsection