@forelse($customers as $customer)
@if($customer->image && file_exists(storage_path('app/public/' . $customer->image)))
@else
{{ strtoupper(substr($customer->name, 0, 1)) }}
@endif
{{ $customer->name }}
{{ $customer->email ?? 'N/A' }} {{ $customer->phone ?? 'N/A' }}
{{ $customer->invoices ? $customer->invoices->count() : 0 }} @php $balance = $customer->invoices ? $customer->invoices->sum('balance') : 0; @endphp
${{ number_format($balance ?? 0, 2) }}
@if($balance > 0)
Overdue
@endif {{ $customer->is_active ? 'Active' : 'Inactive' }}
visibility edit
@empty No customers found @endforelse