@extends('layouts.app') @section('title', 'Support performance') @section('content')

Support performance

{{ $from->format('d M Y') }} – {{ $to->format('d M Y') }}

@include('components.kpi', ['label' => 'Tickets opened', 'value' => number_format($summary['opened']), 'variant' => 'info', 'href' => '#']) @include('components.kpi', ['label' => 'Resolved', 'value' => number_format($summary['resolved']), 'variant' => 'good', 'href' => '#']) @include('components.kpi', ['label' => 'SLA met', 'value' => percent($summary['sla_met']), 'variant' => $summary['sla_met'] >= 90 ? 'good' : 'warn', 'href' => '#']) @include('components.kpi', ['label' => 'Avg first response', 'value' => $summary['avg_first_response'], 'href' => '#']) @include('components.kpi', ['label' => 'Avg resolution', 'value' => $summary['avg_resolution'], 'href' => '#']) @include('components.kpi', ['label' => 'CSAT', 'value' => $summary['csat'] ? number_format($summary['csat'], 1).' / 5' : '—', 'variant' => $summary['csat'] >= 4 ? 'good' : 'warn', 'href' => '#'])

Tickets by month

@include('components.chart', [ 'series' => collect($monthly)->map(fn ($m) => [ 'label' => \Carbon\Carbon::parse($m['month'])->format('M y'), 'value' => $m['opened'], ])->all(), 'type' => 'bar', 'format' => 'number', 'height' => 200, ])

Resolution time trend

@include('components.chart', [ 'series' => collect($monthly)->map(fn ($m) => [ 'label' => \Carbon\Carbon::parse($m['month'])->format('M y'), 'value' => $m['avg_resolution_hours'], ])->all(), 'type' => 'line', 'format' => 'number', 'height' => 200, ])

By category

@php $maxCat = collect($byCategory)->max('total') ?: 1; @endphp @forelse ($byCategory as $category)
{{ $category['category'] }} {{ $category['total'] }}
@empty

No tickets in this period.

@endforelse

By priority

@php $maxPri = collect($byPriority)->max('total') ?: 1; @endphp @forelse ($byPriority as $priority)
{{ title_case_words($priority['priority']) }} {{ $priority['total'] }}
@empty

No tickets in this period.

@endforelse

Agent performance

@forelse ($agents as $agent) @empty @endforelse
AgentAssignedResolved Avg first responseAvg resolutionCSAT
{{ $agent['name'] }} {{ $agent['assigned'] }} {{ $agent['resolved'] }} {{ $agent['avg_first_response'] }} {{ $agent['avg_resolution'] }} {{ $agent['csat'] ? number_format($agent['csat'], 1) : '—' }}
@include('components.empty-state', ['icon' => '👤', 'title' => 'No agent activity'])
@endsection