Attempt to fix N+1 issues still there and more now

This commit is contained in:
Mark Gregory
2026-06-16 20:15:22 +01:00
parent e81a509007
commit a07bfd13df
9 changed files with 65 additions and 72 deletions
@@ -22,7 +22,8 @@ final class WorkflowNotificationService
*/
public function dispatch(Ticket $ticket, string $event, ?User $actor = null): void
{
$ticket->loadMissing(['owner', 'agent', 'status', 'priority', 'category', 'project', 'team', 'product']);
$ticket->loadMissing(['user.company', 'owner.company', 'agent.company', 'status', 'priority', 'category', 'project', 'team', 'product']);
$actor?->loadMissing('company');
WorkflowTemplate::query()
->where('event', $event)