@php $totalAmount = $trend->sum('total_amount'); $totalEntries = $trend->sum('entry_count'); $peakPeriod = $trend->sortByDesc('total_amount')->first(); $maxVal = $trend->max('total_amount'); @endphp {{-- Stat cards --}}
| Period | Summaries | Entries | Avg per Entry | Total Amount | vs Peak |
|---|---|---|---|---|---|
| {{ $row->period }} | {{ number_format($row->summary_count) }} | {{ number_format($row->entry_count) }} | {{ $row->entry_count > 0 ? number_format($row->total_amount / $row->entry_count, 2) : '0.00' }} | {{ number_format($row->total_amount, 2) }} |
|
| Total | {{ number_format($totalAmount, 2) }} | ||||