tenant_id) ->with(['dailyMetrics', 'waitingList']); // Carrega relacionamentos // 2. APLICAR O FILTRO DE SETOR // Se o usuário tiver algo escrito em 'allowed_sector', filtramos. // Se for null, ele pula esse if e traz tudo. if (!empty($user->allowed_sector)) { $query->where('sector', $user->allowed_sector); } // 3. Executa a query $queues = $query->get(); // 4. Entrega para o Vue return Inertia::render('Dashboard', [ 'queues' => $queues ]); } }