@if ($isTrash ?? false) {{ __('Trash /') }} {{ __('deleted contacts') }} @else {{ __('Your') }} {{ __('contacts') }} @endif
@if ($isTrash ?? false) {{ __('Soft-deleted contacts kept safely in database. You can restore them anytime individually or in bulk.') }} @else {{ __('Manage people, groups, imports, and contact details from one operational view.') }} @endif
| {{ __('Name') }} | {{ __('Groups') }} | {{ __('Tags') }} | {{ __('Email') }} | {{ __('Mobile') }} | {{ __('On number') }} | {{ __('Memo') }} | {{ __('Action') }} | |
|---|---|---|---|---|---|---|---|---|
|
{{ $initials }}
{{ $contact->name }}
{{ $contact->language ?? '' }}
{{-- Per-contact attributes (custom_attributes) — e.g. values
imported from a CSV. status/source are surfaced elsewhere,
so they're excluded here to keep this to real attributes. --}}
@php
$allAttrs = is_array($contact->custom_attributes ?? null) ? $contact->custom_attributes : [];
// Raw source_* keys are hidden from the generic attribute chips —
// the number is surfaced in its own "On number" column instead.
$rowAttrs = collect($allAttrs)
->reject(fn ($v, $k) => in_array(strtolower((string) $k), ['status', 'source', 'source_number', 'source_device_id', 'source_provider'], true) || !is_scalar($v) || (string) $v === '')
->take(4);
@endphp
@if ($rowAttrs->isNotEmpty())
@foreach ($rowAttrs as $ak => $av)
{{ \Illuminate\Support\Str::of((string) $ak)->replace('_', ' ')->title() }}: {{ \Illuminate\Support\Str::limit((string) $av, 18) }}
@endforeach
@endif
|
@foreach ($contactGroupModels as $g)
{{ $g->user_group }}
@endforeach
|
{{-- Tags — filled colour pills, deliberately distinct from the
outlined group chips beside them so the two never read as
one list. Clicking a tag filters the table to it. --}}
@forelse ($contact->tags as $t)
@php $tagColor = $t->color ?: 'var(--color-wa-deep)'; @endphp
{{ $t->name }}
@empty
—
@endforelse
|
{{ $contact->email }} | @php // Normalise to ONE display format for every row. Numbers are // stored inconsistently — some plain digits, some with +/spaces, // some with a separate country_code — which made mask_phone show // "xxxxxxxx0909" on one row and "+xx xx xxxx7417" on the next. // Strip to digits, prepend the country code only when it isn't // already inline, then prefix a single "+". $ccDigits = preg_replace('/\D+/', '', (string) ($contact->country_code ?? '')); $numDigits = preg_replace('/\D+/', '', (string) ($contact->mobile ?? '')); $fullDigits = ($ccDigits !== '' && !\Illuminate\Support\Str::startsWith($numDigits, $ccDigits)) ? $ccDigits . $numDigits : $numDigits; @endphp {{ $fullDigits === '' ? '—' : '+' . mask_phone($fullDigits) }} | {{-- Which of the workspace's numbers this contact first messaged (stamped by RoutingEngine on the first inbound). --}}@php $srcNumber = trim((string) ($allAttrs['source_number'] ?? '')); @endphp @if ($srcNumber !== '') +{{ $srcNumber }} @else — @endif | {{ $contact->msg }} |
@if ($isTrash ?? false)
@else
@endif
|
|
| @include('user.partials.empty-state', [ 'message' => ($isTrash ?? false) ? __('No deleted contacts found in trash.') : __('No contacts match the current filters. Try clearing filters or add your first contact.'), 'resetHref' => url('/contacts'), 'actionButtonAttrs' => ($isTrash ?? false) ? '' : 'data-modal-open="contactModal"', 'actionLabel' => ($isTrash ?? false) ? null : __('Add contact'), ]) | ||||||||
{{ $group->user_group }}
{{ $group->note }}
{{ __('A person or customer record with phone, email, notes, language, and group membership used across messages.') }}
{{ __('Create groups for segments like VIPs, new signups, cart abandoners, or local audiences before sending campaigns.') }}
{{ __('Remove invalid numbers, respect unsubscribes, and import only opted-in contacts with a clear source.') }}