@php use App\Services\Leads\LeadModule; use App\Services\Leads\RemarkRule; $sortable = $module->sortable(); $ids = $leads->getCollection()->map(fn ($l) => (string) $l->getKey())->values(); $liveRemarks = collect($module->remarkOptions())->keys()->filter(fn ($r) => RemarkRule::outcome($r) === RemarkRule::LIVE)->values(); $status = request('status'); $statusTabs = [ '' => ['All leads', $stats['total'], 'heroicon-o-inbox-stack', 'blue'], 'new' => ['New', $stats['new'], 'heroicon-o-sparkles', 'violet'], 'live' => ['Live', $stats['live'], 'heroicon-o-bolt', 'green'], 'lost' => ['Lost', $stats['lost'], 'heroicon-o-x-circle', 'red'], ]; @endphp Export CSV {{-- Module switcher --}} @if ($modules->count() > 1)
@endif {{-- Status overview (click to filter) --}}
@foreach ($statusTabs as $key => [$label, $count, $icon, $tone]) @endforeach
@foreach ($filterOptions as $field => $options) @endforeach
{{-- Bulk action bar --}}
selected
@if ($bulkFields) @endif @if ($canDelete)
@csrf @method('DELETE')
@endif
@if ($leads->isEmpty()) @else
@foreach ($module->listColumns() as $col) @endforeach @foreach ($leads as $lead) @php($id = (string) $lead->getKey()) @foreach ($module->listColumns() as $col) @endforeach @endforeach
@if (isset($sortable[$col])) @else {{ $module->columnLabel($col) }} @endif Actions
{{ mb_strtoupper(mb_substr(trim((string) $lead->user_name) ?: '?', 0, 1)) }}
@if ($col === 'live_data') @include('leads.partials.status', ['value' => $lead->live_data]) @elseif ($col === 'due_date') @php($due = LeadModule::parseDate($lead->due_date)) @if ($due) $due->isPast() && ! $due->isToday() && RemarkRule::statusKey($lead->live_data) === 'live', 'font-medium text-brand-700 dark:text-brand-400' => $due->isToday()])> {{ $due->format('d M Y') }} @else — @endif @elseif ($col === 'date') {{ $lead->date ?: '—' }} @else @php($text = $module->display($lead, $col)) $text === ''])>{{ $text !== '' ? \Illuminate\Support\Str::limit($text, 40) : '—' }} @endif
@if ($canDelete)
@csrf @method('DELETE')
@endif
@endif {{-- Bulk update modal (whitelisted fields only) --}} @if ($bulkFields)
@csrf

Applies to selected lead(s).

@foreach ($bulkFields as $field => $options)
@if ($field === 'final_remark')

The status is set automatically: live remarks need a due date, lost remarks clear it.

@endif
@endforeach @if ($module->hasField('due_date'))
@endif
@endif