KPIs by Productivity @php $fmtDuration = function ($seconds) { $hours = $seconds / 3600; if ($hours < 1) return number_format($seconds / 60, 0) . 'm'; if ($hours < 24) return number_format($hours, 1) . 'h'; return number_format($hours / 24, 1) . 'd'; }; $fmtCell = function (array $row, $value) use ($fmtDuration) { if ($value === null) { return ['—', 'text-muted']; } return match ($row['type']) { 'pct' => [number_format($value, 0) . '%', 'text-dark'], 'days' => [number_format($value, 0) . 'd', 'text-dark'], 'ratio' => [number_format($value, 1), 'text-dark'], 'duration' => [$fmtDuration($value), 'text-dark'], 'stock' => [number_format($value), 'text-dark fw-semibold'], default => $value > 0 ? [number_format($value), 'text-dark'] : ['—', 'text-muted'], }; }; $tabs = [ 'day' => ['title' => 'Day', 'hint' => 'last 12 days', 'data' => $day], 'week' => ['title' => 'Week', 'hint' => 'last 12 weeks', 'data' => $week], 'month' => ['title' => 'Month', 'hint' => 'last 12 months', 'data' => $month], ]; @endphp {{-- Filter --}}
Metric “Leads In” and the full pipeline, day-by-day / week-by-week / month-by-month.
{{-- Tabs --}}
@foreach ($tabs as $key => $tab)
@foreach ($tab['data']['labels'] as $label) @endforeach @foreach ($tab['data']['rows'] as $row) @foreach ($row['values'] as $value) @php [$text, $cls] = $fmtCell($row, $value); @endphp @endforeach @endforeach
Metric Target{{ $label }}How it’s calculated
{{ $row['label'] }} @if ($row['sub']) {{ $row['sub'] }} @endif @if ($row['type'] === 'stock') @endif {{ $text }}{{ $row['note'] }}
@endforeach

Rows marked with a clock are point-in-time counts read from the daily 5pm snapshot, so they populate from when snapshots began and fill in going forward.