added support for legacy tickets, fixed switching of modes and also style updates
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user