added support for legacy tickets, fixed switching of modes and also style updates

This commit is contained in:
Mark Gregory
2026-09-28 15:21:32 +01:00
parent fd6646c1ee
commit 0fb4223bfc
30 changed files with 162 additions and 186 deletions
@@ -17,7 +17,9 @@ final class HelpdeskDashboardWidget extends Component
public function updatedDays(): void
{
if (! in_array($this->days, [7, 14, 30], true)) $this->days = 7;
if (! in_array($this->days, [7, 14, 30], true)) {
$this->days = 7;
}
}
public function render(): View
@@ -33,6 +35,7 @@ final class HelpdeskDashboardWidget extends Component
$trendRows = (clone $base)->where('created_at', '>=', now()->subDays($this->days - 1)->startOfDay())->get(['created_at', 'completed_at']);
$trend = collect($period)->map(function ($date) use ($trendRows): array {
$day = $date->toDateString();
return [
'label' => $date->format('M j'),
'created' => $trendRows->filter(fn ($ticket) => optional($ticket->created_at)->toDateString() === $day)->count(),