@foreach($report->getCategories() as $accountCategory) @foreach($accountCategory->data as $categoryAccount) @foreach($categoryAccount as $accountIndex => $categoryAccountCell) @if(is_array($categoryAccountCell) && isset($categoryAccountCell['name'])) @if($categoryAccountCell['name'] === 'Retained Earnings' && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date'])) {{ $categoryAccountCell['name'] }} @elseif(isset($categoryAccountCell['id']) && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date'])) {{ $categoryAccountCell['name'] }} @else {{ $categoryAccountCell['name'] }} @endif @else {{ $categoryAccountCell }} @endif @endforeach @endforeach @foreach($accountCategory->types as $accountType) @foreach($accountType->header as $accountTypeHeaderIndex => $accountTypeHeaderCell) {{ $accountTypeHeaderCell }} @endforeach @foreach($accountType->data as $typeAccount) @foreach($typeAccount as $accountIndex => $typeAccountCell) @if(is_array($typeAccountCell) && isset($typeAccountCell['name'])) @if($typeAccountCell['name'] === 'Retained Earnings' && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date'])) {{ $typeAccountCell['name'] }} @elseif(isset($typeAccountCell['id']) && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date'])) {{ $typeAccountCell['name'] }} @else {{ $typeAccountCell['name'] }} @endif @else {{ $typeAccountCell }} @endif @endforeach @endforeach @foreach($accountType->summary as $accountTypeSummaryIndex => $accountTypeSummaryCell) {{ $accountTypeSummaryCell }} @endforeach @endforeach @foreach($accountCategory->summary as $accountCategorySummaryIndex => $accountCategorySummaryCell) {{ $accountCategorySummaryCell }} @endforeach @endforeach @foreach($report->getOverview() as $overviewCategory) @foreach($overviewCategory->data as $overviewAccount) @foreach($overviewAccount as $overviewIndex => $overviewCell) @if(is_array($overviewCell) && isset($overviewCell['name'])) @if(isset($overviewCell['id']) && isset($overviewCell['start_date']) && isset($overviewCell['end_date'])) {{ $overviewCell['name'] }} @else {{ $overviewCell['name'] }} @endif @else {{ $overviewCell }} @endif @endforeach @endforeach @foreach($overviewCategory->summary as $overviewSummaryIndex => $overviewSummaryCell) {{ $overviewSummaryCell }} @endforeach @if($overviewCategory->header['account_name'] === 'Starting Balance') @foreach($report->getSummary() as $summaryItem) {{ $summaryItem['label'] }} {{ $summaryItem['value'] }} @endforeach @endif @endforeach