Contacts
{{-- Pending approvals banner (manager+) --}} @if (($pendingCount ?? 0) > 0) {{ $pendingCount }} contact{{ $pendingCount > 1 ? 's' : '' }} pending approval — submitted by Clerks. Click to review. @endif {{-- Header --}}

Contacts

{{ $contacts->total() }} {{ \Illuminate\Support\Str::plural('contact', $contacts->total()) }} in this workspace

@can('manage-imports') Import @endcan @can('manage-export') Export @endcan Add contact
{{-- Search & Advanced filters --}}
{{-- Row 1: keyword + group --}}
Search
Search @if (request()->hasAny(['q', 'number', 'city', 'group_id', 'tags', 'status', 'lifecycle_stage', 'rating_min', 'rating_max'])) Clear all @endif
{{-- Row 2: Advanced filters --}}
Number
City
Category (group)
Status
Lifecycle stage
Min rating
Max rating
{{-- Tag filter chips --}} @if ($tags->isNotEmpty())
Tags: @php $activeTags = (array) request('tags', []); @endphp @foreach ($tags as $tag) @php $isActive = in_array($tag->id, $activeTags); $newTags = $isActive ? array_diff($activeTags, [$tag->id]) : array_merge($activeTags, [$tag->id]); $href = request()->fullUrlWithQuery(['tags' => array_values($newTags)]); @endphp {{ $tag->name }} @endforeach
@endif
{{-- Bulk action bar --}}
selected
{{-- Add to group — manager+ only --}} @if (!auth()->user()->isClerk() && $groups->isNotEmpty()) Add to group @foreach ($groups as $group)
@csrf {{ $group->name }}
@endforeach
@endif {{-- Add tag — manager+ only --}} @if (!auth()->user()->isClerk() && $tags->isNotEmpty()) Add tag @foreach ($tags as $tag)
@csrf {{ $tag->name }}
@endforeach
@endif {{-- Send bulk message — manager+ only --}} @if (!auth()->user()->isClerk()) Send message @endif {{-- Trash (soft delete) — all roles --}}
@csrf Cancel 🗑 Move to trash
{{-- Table --}} @if ($contacts->isEmpty())

No contacts yet

Add your first contact to get started.

Add contact
@else Name @foreach ($contacts as $contact) @php // Row background: banned > suspended > rating if ($contact->status === 'banned') { $rowStyle = 'background-color:#fef2f2;border-left:3px solid #ef4444;'; } elseif ($contact->status === 'suspended') { $rowStyle = 'background-color:#fff7ed;border-left:3px solid #f97316;'; } elseif ((int)$contact->rating === 5) { $rowStyle = 'background-color:#f0fdf4;border-left:3px solid #16a34a;'; } elseif ((int)$contact->rating === 4) { $rowStyle = 'background-color:#f0fdf4;border-left:3px solid #86efac;'; } elseif ((int)$contact->rating === 3) { $rowStyle = 'background-color:#eff6ff;border-left:3px solid #3b82f6;'; } elseif ((int)$contact->rating === 2) { $rowStyle = 'background-color:#f0f9ff;border-left:3px solid #93c5fd;'; } elseif ((int)$contact->rating === 1) { $rowStyle = 'background-color:#fdf8f0;border-left:3px solid #92400e;'; } else { $rowStyle = ''; } @endphp
{{ $contact->name }} @if ($contact->status === 'banned') BANNED @elseif ($contact->status === 'suspended') SUSPENDED @elseif ($contact->rating > 0) @for ($i = 1; $i <= 5; $i++)@endfor @endif
{{ $contact->email ?: $contact->phone ?: '—' }}
View @can('update', $contact) Edit @endcan @can('delete', $contact)
@csrf @method('DELETE') Move to trash
@endcan
@endforeach
{{ $contacts->links() }}
@endif