alter N+1 detection process

This commit is contained in:
Mark Gregory
2026-06-26 11:13:23 +01:00
parent 4ae70ba737
commit 788bb87b01
10 changed files with 117 additions and 10 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ final class TicketIndex extends Component
$search = trim($this->search);
return Ticket::query()
->with(['owner', 'agent', 'status', 'priority', 'category', 'project', 'team'])
->with(['user:id,name,email', 'owner:id,name,email', 'agent:id,name,email', 'status', 'priority', 'category', 'project', 'team'])
->withCount('attachments')
->visibleTo($user)
->when($this->scope === 'open', static fn (Builder $query): Builder => $query->whereNull('completed_at'))