@extends('layouts.master')
@section('title', 'Trust Accounts')
@section('content')
Trust Accounts
Client trust ledgers linked to matters.
{{ isset($trustAccounts) ? count($trustAccounts) : 0 }}
Records
Account No.
Client
Matter
Currency
Status
Opened
Actions
@forelse($trustAccounts as $trust)
@php
$matterLabels = $trust->matters?->pluck('matter_number')->filter()->values() ?? collect();
if ($matterLabels->isEmpty() && $trust->matter?->matter_number) {
$matterLabels = collect([$trust->matter->matter_number]);
}
$matterText = $matterLabels->join(', ');
@endphp
{{ $trust->account_number }}
{{ $trust->client?->full_name ?? 'N/A' }}
{{ $matterText ?: 'N/A' }}
{{ $trust->currency ?? 'N/A' }}
{{ ucfirst($trust->status ?? '') }}
{{ optional($trust->opened_at)->format('d M Y') }}
@empty
No trust accounts created.
@endforelse
@endsection