I have the following foreach
to get the id of the devices that were used in each sector:
@foreach($relatorio->Empresa->SetorEmpresa as $setor)
{{ $collection[] = $setor->SetorEmpresaEdificacao->id_aparelho_ruido }}
@endforeach
The problem is that when 2 sectors were measured with the same device, I get this value 2 times. How do I do that does not happen?
I'm getting this way:
array:3 [▼
0 => 1
1 => 1
2 => 2
]
I need to receive this, without repeating:
array:2 [▼
0 => 1
1 => 2
]