@forelse($best_clients ?? [] as $client_id => $total) @php $client = App\Models\User::where('client_id', $client_id)->first(); if(!$client) { continue; } $total_spend = App\Models\Subscription::where('client_id', $client_id)->sum('price'); @endphp @empty @endforelse
{{ __('name') }} {{ __('total_spend') }} {{ __('started_at') }}
{{ $client->first_name.' '.$client->last_name ?? 'Client' }}
{{ $client->first_name.' '.$client->last_name ?? 'Client' }}

{{ $client->email ?? '' }}

{{ get_currency(number_format($total_spend, 2)) }} {{ $client->created_at->format('d M Y') ?? '' }}
{{ __('no_best_clients_found') }}