@php $statCards = collect($stats) ->groupBy(fn ($stat): string => $stat['group'] ?? 'overview') ->flatten(1); @endphp
@foreach($statCards as $stat) @php $hasLink = ! empty($stat['link']); @endphp
{{ $stat['title'] }}
{{ $stat['value'] }}
@if ($hasLink) @endif
@endforeach