@extends('layouts.app', ['title' => $contact->full_name]) @section('content') @php($canManage = auth()->user()->can('contacts.manage')) @php($tz = $currentAccount->timezone)
{{ $contact->initials }}

{{ $contact->full_name }}

{{ \App\Models\Contact::STATUSES[$contact->status] ?? $contact->status }} @if ($contact->company_name) · {{ $contact->job_title ? $contact->job_title.', ' : '' }}{{ $contact->company_name }}@endif · Added {{ $contact->created_at->timezone($tz)->format('d M Y, h:i A') }}@if ($contact->source) via {{ $contact->source }}@endif · Updated {{ $contact->updated_at->timezone($tz)->format('d M Y, h:i A') }}

@if ($canManage && $contact->phone && \App\Models\TelephonyProvider::where('is_active', true)->exists())
@csrf
@endif @if (auth()->user()->can('conversations.manage') && ($contact->phone || $contact->email)) @endif @can('payments.manage') Create invoice @endcan @if ($canManage) Edit
@csrf @method('DELETE')
@endif
@error('call')
{{ $message }}
@enderror
{{-- Left: profile --}}
Contact
Email
@if ($contact->email){{ $contact->email }}@if ($contact->dnd_email) DND@endif @else — @endif
Phone
@if ($contact->phone){{ $contact->phone }} @if ($contact->dnd_whatsapp) DND@endif @else — @endif
Location
{{ collect([$contact->city, $contact->state, $contact->country])->filter()->implode(', ') ?: '—' }}
Birthday
{{ $contact->date_of_birth?->format('d M') ?? '—' }}
Owner
{{ $contact->owner?->name ?? '—' }}
Last activity
{{ $contact->last_activity_at?->diffForHumans() ?? '—' }}
@if ($contact->utm)
Campaign
{{ collect($contact->utm)->map(fn ($v, $k) => str_replace('utm_', '', $k).': '.$v)->implode(' · ') }}
@endif
Tags
@if ($contact->tags->isEmpty())No tags.@endif @include('crm.partials.tags', ['tags' => $contact->tags])
@if ($customFields->isNotEmpty())
Custom fields
@foreach ($customFields as $field) @php($v = $contact->customValue($field))
{{ $field->name }}
{{ $field->type === 'checkbox' ? ($v === '1' ? 'Yes' : ($v === '0' ? 'No' : '—')) : ($v ?? '—') }}
@endforeach
@endif
Opportunities @if ($canManage && $pipelines->isNotEmpty()) @endif
@forelse ($contact->opportunities as $opp)
{{ $opp->title }}
{{ $opp->pipeline?->name }} · {{ $opp->stage?->name }}
{{ money_format_short($opp->value, $currentAccount->currency) }}
{{ ucfirst($opp->status) }}
@empty No opportunities. @endforelse
{{-- Right: activity --}}
{{-- Notes --}}
@if ($canManage)
@csrf
@if ($contact->opportunities->isNotEmpty()) @endif
@endif @forelse ($contact->notes->sortByDesc('is_pinned') as $note)
{{ $note->user?->name ?? 'System' }} · {{ $note->created_at->timezone($tz)->format('d M Y, h:i A') }}@if ($note->opportunity_id && ($deal = $contact->opportunities->firstWhere('id', $note->opportunity_id))) · {{ $deal->title }}@endif @if ($canManage)
@csrf @method('PUT')
@csrf @method('DELETE')
@endif
{{ $note->body }}
@empty
No notes yet.
@endforelse
{{-- Tasks --}}
@if ($canManage)
@csrf
@endif @forelse ($contact->tasks as $task) @include('crm.partials.task-row', ['task' => $task, 'showContact' => false]) @empty
No tasks.
@endforelse
{{-- Timeline --}}
@if ($timeline->isEmpty())
Nothing has happened yet.
@else
    @foreach ($timeline as $log)
  • {{ $log->description }} @if ($log->user)by {{ $log->user->name }}@endif
    {{ $log->created_at->timezone($tz)->format('d M Y, h:i A') }}
  • @endforeach
@endif
@if ($canManage && $pipelines->isNotEmpty()) @endif @endsection