Dashboard @php $user = auth()->user(); $team = $user->currentTeam; $accents = [ 'violet' => ['bg' => 'bg-primary/10', 'text' => 'text-primary'], 'blue' => ['bg' => 'bg-blue-500/10', 'text' => 'text-blue-600 dark:text-blue-400'], 'emerald' => ['bg' => 'bg-emerald-500/10', 'text' => 'text-emerald-600 dark:text-emerald-400'], 'amber' => ['bg' => 'bg-amber-500/10', 'text' => 'text-amber-600 dark:text-amber-400'], ]; $stageColors = [ 'lead' => 'bg-blue-500', 'prospect' => 'bg-violet-500', 'customer' => 'bg-emerald-500', 'partner' => 'bg-amber-500', 'vendor' => 'bg-rose-500', ]; $hour = (int) now()->format('H'); $greeting = $hour < 12 ? 'Good morning' : ($hour < 18 ? 'Good afternoon' : 'Good evening'); @endphp @php $totalContacts = \App\Models\Contact::count(); $totalMessages = \App\Models\Message::count(); $twilioConfigured = ! app(\App\Settings\TwilioSettings::class)->fake_mode; $aiConfigured = ! app(\App\Settings\AnthropicSettings::class)->fake_mode; $teamMemberCount = $team ? ($team->members()->count() + 1) : 1; $steps = [ ['title' => 'Add your first contact', 'desc' => 'Use the "Add contact" button or paste a signature for AI to extract the fields.', 'href' => route('contacts.create'), 'cta' => 'Add contact', 'done' => $totalContacts > 0], ['title' => 'Import existing contacts', 'desc' => 'Download the CSV template, fill it in, then upload โ€” auto-mapping included.', 'href' => route('imports.form'), 'cta' => 'Import CSV', 'done' => $totalContacts > 5], ['title' => 'Connect Twilio', 'desc' => 'Drop your SID, token, and phone number to enable real SMS, WhatsApp, and calls.', 'href' => route('settings.twilio'), 'cta' => 'Configure Twilio', 'done' => $twilioConfigured], ['title' => 'Add your Anthropic key', 'desc' => 'Switch on real AI for contact enrichment, spell-check, translation, and tag suggestions.', 'href' => route('settings.ai'), 'cta' => 'Configure AI', 'done' => $aiConfigured], ['title' => 'Send your first message', 'desc' => 'Open any contact with a phone, click SMS or WhatsApp, and reach out.', 'href' => route('sms.index'), 'cta' => 'Open messages', 'done' => $totalMessages > 0], ['title' => 'Invite your team', 'desc' => 'Share the workspace with teammates โ€” they get their own login and access to your contacts.', 'href' => route('workspace.members'), 'cta' => 'Invite teammate', 'done' => $teamMemberCount > 1], ]; $doneCount = collect($steps)->where('done', true)->count(); $totalSteps = count($steps); @endphp
{{-- Onboarding checklist (dismissible) --}}
๐Ÿš€ Getting started {{ $doneCount }} of {{ $totalSteps }} steps complete. Click each item below for guidance.
@foreach ($steps as $i => $step)
$step['done'], 'border-border bg-card hover:bg-accent/30' => !$step['done'], ])>
$step['done'], 'border border-input bg-background text-muted-foreground' => !$step['done'], ])> @if ($step['done']) @else {{ $i + 1 }} @endif

$step['done']])>{{ $step['title'] }}

{{ $step['desc'] }}

@if (! $step['done']) {{ $step['cta'] }} โ†’ @endif
@endforeach
{{-- Greeting + quick actions strip --}}

{{ $team?->name ?? 'Workspace' }}

{{ $greeting }}, {{ explode(' ', $user->name)[0] }}.

Here's what needs your attention today.

{{-- KPI cards --}}
@foreach ($kpis as $k) @php $a = $accents[$k['accent']]; $d = $k['delta']; @endphp
$d['direction'] === 'up', 'bg-rose-500/10 text-rose-600 dark:text-rose-400' => $d['direction'] === 'down', 'bg-muted text-muted-foreground' => $d['direction'] === 'flat', ])> @if ($d['direction'] === 'up') @elseif ($d['direction'] === 'down') @endif {{ $d['label'] }}
{{ number_format($k['value']) }}
{{ $k['label'] }} {{ $k['hint'] }}
@endforeach
{{-- Pipeline --}}
Pipeline Contacts by lifecycle stage.
View all โ†’
@foreach ($pipeline as $row)
{{ $row['stage'] }} {{ $row['count'] }} ยท {{ $row['percent'] }}%
@endforeach
{{-- Activity feed --}} Recent activity Across SMS, calls, and email. @if ($activity->isEmpty())

No activity yet.

@else
    @foreach ($activity as $item) @php $colors = [ 'sms' => 'bg-blue-500/10 text-blue-600 dark:text-blue-400', 'whatsapp' => 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400', 'call' => 'bg-amber-500/10 text-amber-600 dark:text-amber-400', 'email' => 'bg-violet-500/10 text-violet-600 dark:text-violet-400', ]; $color = $colors[$item['type']] ?? 'bg-muted'; $icon = match ($item['type']) { 'call' => 'M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z', 'email' => 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z', default => 'M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z', }; $verb = match (true) { $item['type'] === 'sms' && $item['direction'] === 'outbound' => 'Sent SMS', $item['type'] === 'sms' && $item['direction'] === 'inbound' => 'Received SMS', $item['type'] === 'whatsapp' && $item['direction'] === 'outbound' => 'Sent WhatsApp', $item['type'] === 'whatsapp' && $item['direction'] === 'inbound' => 'Received WhatsApp', $item['type'] === 'call' => 'Logged call', default => 'Sent email', }; @endphp
  • {{ $verb }} @if ($item['contact']) to {{ $item['contact']->name }} @endif

    {{ $item['when']?->diffForHumans(short: true) }}
    @if ($item['preview'])

    {{ $item['preview'] }}

    @endif
  • @endforeach
@endif
{{-- Reminders --}}
Today's reminders @if ($overdueCount > 0) {{ $overdueCount }} overdue @endif
All โ†’
@if ($upcomingReminders->isEmpty())
No pending reminders. Schedule one.
@else
    @foreach ($upcomingReminders as $r)
  • @csrf @method('PATCH')
    {{ $r->title }}
    $r->isOverdue(), 'text-muted-foreground' => !$r->isOverdue(), ])>{{ $r->remind_at->diffForHumans() }}{{ $r->contact ? ' ยท '.$r->contact->name : '' }}
  • @endforeach
@endif
{{-- Hot prospects --}} @if ($hotProspects->isNotEmpty()) ๐Ÿ”ฅ Hot prospects VIP, hot, enterprise, or follow-up tags. @endif @if ($upcomingBirthdays->isNotEmpty()) ๐ŸŽ‚ Birthdays
    @foreach ($upcomingBirthdays as $contact)
  • {{ $contact->name }}

    {{ $contact->birthday?->format('M j') }}

  • @endforeach
@endif