title: Laravel whereIn in array
body: <p>I have array of collections. In collections I have relation. How I can use <code>whereIn</code> in these relations?</p>
  
  <pre><code>$arrayCollections = $category-&gt;products;
  
  $arrayCollections = $arrayCollections-&gt;character-&gt;whereIn('id', [1,2,3,4]); //I need use whereIn in character relation. I get error: Property [character] does not exist on this collection instance.
  
  foreach($arrayCollections as $product) {
      .... //but in foreach I can use $product-&gt;character
  }
  </code></pre>
  
  <p>Relation in product model::</p>
  
  <pre><code>public function character()
  {
      return $this-&gt;hasMany('App\Models\ProductCharacter');
  }
  </code></pre>