title: Laravel 5.8 - Get values from pluck result
body: <p>I need help to make this code work. After make a search by a Software, my controller return the locals who have the software instaled, and the S.O. who has the same.
  For exemple, this query will return "1 2", because this two images has "Google Chrome".</p>
  
  <pre><code>    $img_id = Software::where('application', $request-&gt;input('application'))-&gt;pluck('imagem_id');
  </code></pre>
  
  <p>And than, I need to list all the locals ho have this image, after consequence o the search by the Software.</p>
  
  <pre><code>    $ambientes = Ambiente::where('imagem_id', $img_id)-&gt;get();
  </code></pre>
  
  <p>But she only show me the locals who have the imagem_id = 1, even I using a foreach in view:</p>
  
  <pre><code>    @foreach ($ambientes as $value)
      &lt;tr&gt;
         &lt;td&gt;{{ $value-&gt;unidade-&gt;name }}&lt;/td&gt;
         &lt;td&gt;{{ $value-&gt;bloco-&gt;name }}&lt;/td&gt;
         &lt;td&gt;{{ $value-&gt;name }}&lt;/td&gt;
         &lt;td&gt;{{ $value-&gt;imagem_id }}&lt;/td&gt;
      &lt;/tr&gt;
      @endforeach
  </code></pre>
  
  <p>What I need to do to show every locals who has the image_id = 1 and 2??</p>
  
  <p>Tks</p>