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

{{ $client->name }}

Client profile and appointment history

Contact Information

Email
@if($client->email) {{ $client->email }} @else Not provided @endif
Phone
@if($client->phone) {{ $client->phone }} @else Not provided @endif
Client Since
{{ $client->created_at->format('F j, Y') }}
@if($client->notes)

Notes

{{ $client->notes }}

@endif @php $bodyParts = $client->appointments->flatMap->bodyParts->unique('id'); @endphp @if($bodyParts->count() > 0)

Tattoo Locations

@foreach($bodyParts as $bodyPart) {{ $bodyPart->label }} @endforeach
@endif @php $healingPhotos = $client->appointments ->flatMap->images ->whereIn('type', ['before', 'during', 'after', 'healed']) ->sortBy('healing_stage_date'); @endphp @if($healingPhotos->count() > 0)

Tattoo Journey Timeline

{{ $healingPhotos->count() }} photos
@php $stageOrder = ['before' => 1, 'during' => 2, 'after' => 3, 'healed' => 4]; $stages = $healingPhotos->groupBy('type')->sortBy(function($photos, $type) use ($stageOrder) { return $stageOrder[$type] ?? 99; }); @endphp @foreach($stages as $stage => $photos)
@switch($stage) @case('before') @break @case('during') @break @case('after') @break @case('healed') @break @endswitch

{{ $stage }} Session

{{ $photos->count() }} {{ Str::plural('photo', $photos->count()) }}

@foreach($photos as $photo)
{{ ucfirst($stage) }} photo
@if($photo->healing_stage_date)

{{ $photo->healing_stage_date->format('M d, Y') }}

@endif @if($photo->notes)

{{ $photo->notes }}

@endif
@endforeach
@endforeach
@endif

Appointment History

@if($client->appointments->count() > 0)
@foreach($client->appointments as $appointment) @endforeach
Date Status Body Parts Price Tip Total Actions
{{ $appointment->scheduled_at->format('M d, Y g:i A') }} @php $statusColors = [ 'pending' => 'bg-yellow-50 text-yellow-700 ring-yellow-600/20', 'confirmed' => 'bg-blue-50 text-blue-700 ring-blue-600/20', 'completed' => 'bg-green-50 text-green-700 ring-green-600/20', 'cancelled' => 'bg-red-50 text-red-700 ring-red-600/20', ]; @endphp {{ ucfirst($appointment->status) }} @if($appointment->bodyParts->count() > 0)
@foreach($appointment->bodyParts->take(3) as $bodyPart) {{ $bodyPart->label }}{{ !$loop->last ? ',' : '' }} @endforeach @if($appointment->bodyParts->count() > 3) +{{ $appointment->bodyParts->count() - 3 }} more @endif
@else Not specified @endif
@if($appointment->price) ${{ number_format($appointment->price, 2) }} @else - @endif @if($appointment->tip_amount) ${{ number_format($appointment->tip_amount, 2) }} @else - @endif ${{ number_format(($appointment->price ?? 0) + ($appointment->tip_amount ?? 0), 2) }} Edit
@else

No appointments

Get started by creating a new appointment for this client.

@endif

Recommendations

Analyzing patterns...

Statistics

Total Appointments
{{ $client->appointments->count() }}
Completed Sessions
{{ $client->appointments->where('status', 'completed')->count() }}
Lifetime Value
${{ number_format($client->appointments->sum(fn($apt) => ($apt->price ?? 0) + ($apt->tip_amount ?? 0)), 2) }}
Upcoming Appointments
{{ $client->appointments->where('scheduled_at', '>', now())->where('status', '!=', 'cancelled')->count() }}

Quick Actions

Book Appointment Edit Profile @if($client->email) Send Email @endif @if($client->phone) Call Client @endif
@endsection