@extends('layouts.admin', [ 'title' => 'Customer Profile', 'pageTitle' => 'Customer Profile', 'active' => 'customers', ]) @php $statusVariants = [ 'active' => 'success', 'vip' => 'primary', 'new' => 'purple', 'inactive' => 'muted', ]; $appointmentVariants = [ 'pending' => 'warning', 'confirmed' => 'primary', 'checked_in' => 'purple', 'completed' => 'success', 'cancelled' => 'danger', 'no_show' => 'muted', ]; $invoiceVariants = [ 'draft' => 'muted', 'unpaid' => 'warning', 'partial' => 'warning', 'paid' => 'success', 'overdue' => 'danger', 'cancelled' => 'muted', ]; @endphp @section('content')
Back to Customers
Send Reminder Edit Customer
@if (session('status'))
{{ session('status') }}
@endif
{{ $customer->initials }}

{{ $customer->name }}

{{ $customer->status_label }}

Customer since {{ $customer->created_at?->format('M d, Y') ?? 'Recently' }}

Lifetime Value

${{ number_format((float) $customer->total_spent, 2) }}

Appointments

{{ $customer->appointments_count }}

Completed

{{ $customer->completed_appointments_count }}

No Shows

{{ $customer->no_show_appointments_count }}

Balance Due

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

@if ($appointments->isNotEmpty())
@foreach (['Service', 'Staff', 'Date & Time', 'Status', 'Amount'] as $heading) @endforeach @foreach ($appointments as $appointment) @php $appointmentStatus = is_object($appointment->status) ? $appointment->status->value : $appointment->status; $appointmentLabel = \Illuminate\Support\Str::headline((string) $appointmentStatus); @endphp @endforeach
{{ $heading }}
{{ $appointment->service?->name ?? 'Service removed' }} {{ $appointment->staffProfile?->name ?? 'Unassigned' }}

{{ $appointment->starts_at?->format('M d, Y') ?? 'Not scheduled' }}

{{ $appointment->starts_at?->format('g:i A') ?? '' }}

{{ $appointmentLabel }} ${{ number_format((float) $appointment->price, 2) }}
@else
No appointments have been recorded for this customer yet.
@endif
@if ($invoices->isNotEmpty())
@foreach (['Invoice', 'Date', 'Service', 'Amount', 'Status'] as $heading) @endforeach @foreach ($invoices as $invoice) @php $invoiceStatus = is_object($invoice->status) ? $invoice->status->value : $invoice->status; $invoiceLabel = \Illuminate\Support\Str::headline((string) $invoiceStatus); $invoiceService = $invoice->appointment?->service?->name ?? $invoice->items->first()?->service?->name ?? $invoice->items->first()?->description ?? 'Service invoice'; @endphp @endforeach
{{ $heading }}
{{ $invoice->invoice_number }} {{ $invoice->issue_date?->format('M d, Y') ?? 'Draft' }} {{ $invoiceService }} ${{ number_format((float) $invoice->total, 2) }} {{ $invoiceLabel }}
@else
No invoices have been created for this customer yet.
@endif
{{ $customer->phone ?: 'No phone saved' }}
{{ $customer->email ?: 'No email saved' }}
{{ $customer->address ?: 'No address saved' }}
Birthday{{ $customer->birthday?->format('M d') ?? 'Not set' }}
Source{{ $customer->source ?: 'Manual' }}
Last Visit{{ $customer->last_visit_at?->format('M d, Y') ?? 'No visits yet' }}
@forelse ($notes as $note)

{{ $note['author'] ?? 'Team member' }}

{{ isset($note['date']) ? \Illuminate\Support\Carbon::parse($note['date'])->format('M d, Y') : 'Today' }}

{{ $note['text'] ?? '' }}

@empty
No internal notes yet.
@endforelse
@csrf Save Note
@push('modals') @include('admin.customers.partials.edit-modal', ['customer' => $customer, 'modalId' => 'edit-customer-modal-' . $customer->id]) @endpush @endsection