Pipeline KPIs @php $fmt = function ($value, string $type) { if ($value === null) { return '—'; } return match ($type) { 'percent' => number_format($value, 1) . '%', 'days' => number_format($value, 1) . 'd', default => number_format($value), }; }; // Inline SVG sparkline over the daily series (uses currentColor, so the // parent's text-{accent} class tints it). Includes a soft area fill. $spark = function (array $s): string { $n = count($s); if ($n < 2) { return ''; } $min = min($s); $max = max($s); $range = max(1, $max - $min); $w = 100.0; $h = 28.0; $pad = 3.0; $pts = []; foreach ($s as $i => $v) { $x = round(($i / ($n - 1)) * $w, 2); $y = round($h - $pad - (($v - $min) / $range) * ($h - 2 * $pad), 2); $pts[] = "$x,$y"; } $line = implode(' ', $pts); $area = '0,' . $h . ' ' . $line . ' ' . $w . ',' . $h; // close the fill to the baseline return '' . '' . '' . ''; }; // Net change across the visible series. $dir decides good/bad colouring: // 'down' = fewer is better, 'up' = more is better, 'neutral' = no judgement. $netTrend = function (array $s, string $dir = 'down'): string { $net = end($s) - reset($s); $arr = $net < 0 ? '▼' : ($net > 0 ? '▲' : '●'); if ($net === 0) { return '● 0 · 14d'; } $good = match ($dir) { 'up' => $net > 0, 'down' => $net < 0, default => null, }; $cls = $good === null ? 'bg-light text-muted' : ($good ? 'bg-success-subtle text-success' : 'bg-danger-subtle text-danger'); return '' . $arr . ' ' . number_format(abs($net)) . ' · 14d'; }; @endphp {{-- Subtitle + filter --}}
Current backlog up top · pipeline flow (Day / Week / Month) below
{{-- Current backlog / snapshot metrics — stat cards --}}
Right now
@foreach ($currentCards as $card)
{{ $card['label'] }} @if ($card['fivePm']) 5pm @endif
{{ number_format($card['value']) }} @if ($card['series']) {!! $netTrend($card['series'], $card['dir']) !!} @endif
@if ($card['series'])
{!! $spark($card['series']) !!}
@else
current value
@endif @if ($card['note'])
{{ $card['note'] }}
@endif
@endforeach
{{-- Pipeline flow — one panel (card) per stage, each with its own table --}}
Pipeline flow
@foreach ($sections as $section)
{{ $section['title'] }}
@foreach ($section['rows'] as $row) @endforeach
Metric Day Week Month Lst Wk Lst Mo
{{ $row['label'] }} @if ($row['sub']) {{ $row['sub'] }} @endif {{ $fmt($row['values']['today'], $row['type']) }} {{ $fmt($row['values']['week'], $row['type']) }} {{ $fmt($row['values']['month'], $row['type']) }} {{ $fmt($row['values']['histWeek'], $row['type']) }} {{ $fmt($row['values']['histMonth'], $row['type']) }}
@endforeach
@unless ($showDeltas)

Backlog trend arrows are hidden while a lead source is selected — daily snapshots are recorded across all lead sources.

@endunless