@extends('crm.master') @section('title', 'Customers') @section('content')

Customers

@forelse($customers as $customer) @php $latestBooking = $customer->bookings->sortByDesc('start_datetime')->first(); @endphp @empty @endforelse
Customer Customer ID Bookings Total Last Booking Status Location Created
{{ $customer->name }} @if($customer->email) {{ $customer->email }} @endif
{{ $customer->hash_id }} @if($customer->bookings_count) {{ $customer->bookings_count }} @else 0 @endif ${{ number_format((float) ($customer->bookings_total ?? 0), 2) }} @if($customer->last_booking_at) {{ \Carbon\Carbon::parse($customer->last_booking_at)->format('M j') }} @if($latestBooking) {{ $latestBooking->booking_number }} @endif @else - @endif {{ ucfirst($customer->status ?: 'inactive') }} @if($customer->address || $customer->city || $customer->country)
@if($customer->address)
{{ $customer->address }}
@endif @if($customer->city || $customer->state || $customer->postal_code)
{{ trim(collect([$customer->city, $customer->state, $customer->postal_code])->filter()->implode(', '), ', ') }}
@endif @if($customer->country)
{{ $customer->country }}
@endif
@else - @endif
{{ $customer->created_at?->format('M j, Y') }}
No customers found.
@if($customers->hasPages()) @endif
@endsection