@extends('layouts.user_type.auth') @section('pageActions') New campaign @endsection @section('marketingLabs') @include('pages_admin.marketing._nav') @include('components.alert') @php $mlStages = ['new', 'contacted', 'interested', 'demo_done', 'pilot', 'customer', 'not_interested', 'invalid']; $mlCurrent = (string) request('status', ''); $mlStatusOptions = collect(\App\Models\Admin\MarketingLabs::STATUSES)->map(fn ($label, $value) => '')->implode(''); @endphp
{{ $marketingLabs->total() }} labs
@forelse ($marketingLabs as $index => $marketingLab) @php $mlInit = collect(preg_split('/\s+/', trim($marketingLab->laboratory_name ?? '')))->filter()->take(2)->map(fn ($w) => mb_strtoupper(mb_substr($w, 0, 1)))->implode(''); $mlActivity = collect([ ['Clicked a link', $marketingLab->last_clicked_at], ['Replied', $marketingLab->replied_at], ['Opened', $marketingLab->last_opened_at], ['Emailed', $marketingLab->last_contacted_at], ])->filter(fn ($a) => $a[1])->sortByDesc(fn ($a) => $a[1]->timestamp)->first(); $mlEnr = $marketingLab->activeEnrollment; @endphp @empty @endforelse
Laboratory Contact Location Stage Last activity
{{ $mlInit ?: '?' }} {{ $marketingLab->laboratory_name }} {{ str_replace(['Calibration_and_testing', '_'], ['Calibration & testing', ' '], $marketingLab->lab_type) }}@if ($marketingLab->contact_person) · {{ $marketingLab->contact_person }}@endif
@if ($marketingLab->contact_email) {{ $marketingLab->contact_email }} @if (in_array($marketingLab->email_status, ['bounced', 'unsubscribed', 'invalid'], true)) {{ $marketingLab->email_status }} @endif @else No email @endif @if ($marketingLab->contact_mobile)
{{ $marketingLab->contact_mobile }}
@endif
{{ $marketingLab->city ?: '—' }}@if ($marketingLab->state)
{{ $marketingLab->state }}
@endif
@include('pages_admin.marketing._stage', ['status' => $marketingLab->status]) @if ($mlEnr)
Email {{ $mlEnr->current_step }} · {{ \Illuminate\Support\Str::limit($mlEnr->campaign?->name, 22) }}
@endif
@if ($mlActivity) {{ $mlActivity[0] }}
{{ $mlActivity[1]->diffForHumans() }}
@else — @endif @if ($marketingLab->openTask)
Follow up {{ $marketingLab->openTask->due_at?->isToday() ? 'today' : $marketingLab->openTask->due_at?->diffForHumans() }}
@endif
@if ($marketingLab->is_deleted === 'active') @include('pages_admin.marketing._lab-actions', ['lab' => $marketingLab])
@csrf
@else
@csrf
@endif
No marketing labs
Add a lab or import an Excel sheet to start outreach.
@include('components.pagination', ['paginator' => $marketingLabs])
@include('pages_admin.marketing._stage-modal') @endsection