@extends('layouts.app')
@section('title', $customer->name)
@section('content')
@php
$profile = $customer->profile;
$phone = optional($profile)->phone ?: $customer->phone;
$dial = optional($profile)->country_code;
$extraPhone = trim((string) optional($profile)->additional_country_code . ' ' . (string) optional($profile)->additional_phone);
$personalAddress = collect([
optional($profile)->address_1,
optional($profile)->address_2,
optional($profile)->street_address,
optional($profile)->city,
optional($profile)->island,
optional($profile)->postal_code,
])->filter()->implode(', ');
$maldivesProfile = strtoupper((string) optional(optional($profile)->nationalityCountry)->country_code) === 'MV';
@endphp
{{ $completion['label'] }}
@if($completion['fully_updated'])
Profile details and a delivery address are saved.
@elseif($completion['profile_ready'])
Profile details are saved. A delivery address is still needed.
@else
Profile details are still incomplete.
@endif
Account
- Full name
- {{ $customer->name }}
- Registered
- {{ optional($customer->created_at)->format('d M Y, h:i A') }}
- Created by
-
@if($customer->registered_by_wuser_id)
Warehouse user{{ optional($customer->registeredByWarehouse)->name ? ' · ' . $customer->registeredByWarehouse->name : '' }}
@else
Customer
@endif
- Email verification
- {{ $customer->registered_by_wuser_id ? 'Not required · marked verified' : ($customer->email_verified_at ? 'Verified' : 'Not verified') }}
Contact
- Telephone
- {{ trim(($dial ? $dial . ' ' : '') . ($phone ?: '')) ?: 'Not added' }}
- Additional telephone
- {{ $extraPhone !== '' ? $extraPhone : 'Not added' }}
- WhatsApp
- {{ trim((string) optional($profile)->whatsapp_country_code . ' ' . (string) optional($profile)->whatsapp_number) ?: 'Not added' }}
- Nationality
- {{ optional(optional($profile)->nationalityCountry)->country_name ?: (optional($profile)->country ?: 'Not added') }}
- {{ $maldivesProfile ? 'Atoll / island' : 'State / district' }}
- {{ collect([optional(optional($profile)->state)->state_name, optional(optional($profile)->district)->district_name])->filter()->implode(', ') ?: 'Not added' }}
Personal details
- Date of birth
- {{ $profile && $profile->date_of_birth ? $profile->date_of_birth->format('d M Y') : 'Not added' }}
- Gender
- {{ $profile && $profile->gender ? ucfirst($profile->gender) : 'Not added' }}
- Address
- {{ $personalAddress !== '' ? $personalAddress : 'Not added' }}
Photo and identity
@if(!empty($canManage) && $profile && $profile->profile_photo_path)
 }})
@elseif($profile && $profile->profile_photo_path)
Photo on file
@else
No photo
@endif
@php $shownDocument = false; @endphp
@foreach($documents as $document)
@if($profile && filled($profile->{$document['number']}))
@php $shownDocument = true; @endphp
{{ $document['label'] }}: {{ $profile->{$document['number']} }}
@if(!empty($canManage) && filled($profile->{$document['file']}))
View file
@endif
@endif
@endforeach
@if(!$shownDocument)
No identity document saved yet.
@endif
Delivery addresses
@php
$addresses = $customer->virtualAddresses->filter(function ($row) {
return filled($row->delivery_address_1);
});
@endphp
@forelse($addresses as $address)
{{ $address->suite_number ?: 'Suite pending' }}
{{ $address->label ? ucfirst($address->label) : 'Address' }}
{{ collect([
$address->recipient_name,
$address->delivery_address_1,
$address->delivery_address_2,
$address->delivery_street_address,
$address->delivery_city,
optional($address->deliveryState)->state_name,
optional($address->deliveryDistrict)->district_name,
$address->delivery_region,
$address->delivery_postal_code,
$address->delivery_phone,
optional($address->resort)->name,
])->filter()->unique()->implode(', ') }}
Warehouse: {{ optional($address->wuser)->name ?: 'Not assigned' }}@if(optional($address->wuser)->warehouse_code) ({{ $address->wuser->warehouse_code }})@endif
@empty
No delivery address saved yet.
@endforelse
@endsection
@push('styles')
@endpush