@extends('layouts.app') @section('title', 'Customers') @section('page', 'customers') @section('customersNav', 'list') @php $statusVariant = fn ($s) => $s === 'Active' ? 'success' : 'danger'; $toneCycle = ['primary', 'success', 'warning', 'info', 'danger']; $totalCustomers = $customers->count(); $activeCustomers = $customers->where('status', 'Active')->count(); $inactiveCustomers = $customers->where('status', 'Inactive')->count(); $totalOutstanding = $customers->sum('outstanding_amount'); @endphp @section('content') @include('partials.customers-nav') @if (session('success')) {{ session('success') }} @endif @if ($errors->any()) {{ $errors->first() }} @endif

Total Customers

{{ $totalCustomers }}

All customer records

Active

{{ $activeCustomers }}

Currently in use

Outstanding

{{ number_format((float) $totalOutstanding, 2) }}

Total due amount

Inactive

{{ $inactiveCustomers }}

Not available

@forelse ($customers as $row) @php $tone = $toneCycle[($loop->index) % count($toneCycle)]; @endphp {{ $row->name }} @if ($row->is_locked) Default @endif {{ $row->phone ?: '—' }} {{ $row->location ?: '—' }} @if ($row->membership) {{ $row->membership->name }} @else — @endif @if ($row->group) {{ $row->group->name }} @else — @endif @if ($row->priceGroup) {{ $row->priceGroup->name }} @else — @endif {{ number_format((int) $row->loyalty_points) }} {{ number_format((float) $row->outstanding_amount, 2) }} {{ $row->status }}
@if ($row->is_locked) @else @endif
@empty No customers yet. Add your first customer. @endforelse
@endsection @push('styles') @endpush @push('scripts') @endpush