@extends('crm.layouts.app') @section('title', 'Analytics') @section('content')

Client Analytics

Track appointments, revenue, and client insights

Total Appointments
{{ $totalAppointments }}
Revenue
${{ number_format($totalRevenue, 2) }}
Tips
${{ number_format($totalTips, 2) }}
No-Shows
{{ $totalCancelled }}

Top 5 Clients

@if(count($topClients) > 0)
@foreach ($topClients as $clientId => $count) @php $index = $loop->index; @endphp @endforeach
Rank Client Name Visits
@if($index == 0) @else {{ $index + 1 }} @endif
{{ \App\Models\Client::find($clientId)?->name ?? 'Unknown' }} {{ $count }} visits
@else

No client data

No appointments found for the selected period.

@endif

Most Tattooed Body Zones

@if(count($bodyZoneCounts) > 0)
@foreach ($bodyZoneCounts as $zone => $count) @php $maxCount = max($bodyZoneCounts); $percentage = $maxCount > 0 ? ($count / $maxCount) * 100 : 0; @endphp
{{ $zone }} {{ $count }} times
@endforeach
@else

No body zone data

No appointments found for the selected period.

@endif
@endsection