title: Laravel return data that matches two tables
body: <p>i have two different tables like these:</p>
  
  <p>Table:products</p>
  
  <p><code>id-&gt;1
  name-&gt;pencil
  siz-&gt;big
  </code></p>
  
  <p>Table:colours</p>
  
  <p><code>id-&gt;2
  colour_name-&gt;red
  product_id-&gt;1</code></p>
  
  <p>Here is my codes in controller;</p>
  
  <pre><code>$products= Product::where('active', 1);
  
  if ($request-&gt;has('size')) {
     $products-&gt;whereIn('size', $request-&gt;input('size'));
  }
  
  $products= $products-&gt;paginate(10);
  
  return view('pencil.index', compact("products"));
  </code></pre>
  
  <p>The results are filtered by request's size values. But the problem colours in different table, how can i do the correct query for colour filters ? Thank you.</p>