@php $grandTotal = 0; /*$key = array_column($liveSales, 'total_sale'); array_multisort($key, SORT_DESC, $liveSales);*/ @endphp @if (count($liveSales) > 0) @php $maxSales = max(array_column($liveSales, 'total_sale')); $grandTotal = array_sum(array_column($liveSales, 'total_sale')); @endphp @foreach ($liveSales as $value) @php $total = numberFormat($value['total_sale'], 1, false); $percentage = calPercentage($value['total_sale'], $maxSales); $liveIcon = ''; if ($value['is_active']) { $liveIcon = ''; } @endphp {!! $liveIcon . '  ' . $value['city'] !!} {{ $total }}
@endforeach @php $totalSales = numberFormat($grandTotal, 1, false); @endphp Total ({!! count($liveSales) !!}) {{ $totalSales }} @endif