title: laravel Using multiple whereIn to filter out a product from table
body: <p>This is my table <strong>Variation</strong></p>
  
  <pre><code>+---------------+---------+------------+-----------+--------+---------+----------+
  |  product_id   | sku_id  | option_id  | value_id  |  sku   | option  |  value   |
  +---------------+---------+------------+-----------+--------+---------+----------+
  |           18  |     11  |         7  |        7  | wsu34  | size    | 7        |
  |           18  |     11  |         8  |        8  | wsu34  | color   | #2A2947  |
  |           18  |     12  |         7  |        9  | ws52   | size    | 5        |
  |           18  |     12  |         8  |       10  | ws52   | color   | #64556d  |
  |           18  |     13  |         7  |       11  | wsu34  | size    | 10       |
  |           18  |     13  |         8  |       12  | wsu34  | color   | #64556d  |
  +---------------+---------+------------+-----------+--------+---------+----------+
  </code></pre>
  
  <p>I want to pick a product by filtering the columns 'option' and 'value'</p>
  
  <pre><code>$opt = [size", "color"];
  $val = ["5", "#2A2947"];
  
  $kf = Variation::whereIn('option', $opt)
               -&gt;whereIn('value',$val)-&gt;where('product_id', 18)
               -&gt;pluck('sku');
  </code></pre>
  
  <p>The sql query was </p>
  
  <blockquote>
    <p>"select * from <code>variations</code> where <code>option</code> in (?, ?) and <code>value</code> in
    (?, ?)"</p>
  </blockquote>
  
  <p>The desired result was supposed to be <strong>wsu34</strong>  </p>
  
  <p>But I was getting the wrong values.</p>
  
  <p><strong>edit</strong></p>
  
  <p>differnt query with</p>
  
  <pre><code>  $opt = [size", "color"];
    $val = ["10", "#64556d"];
  
  $kf = Variation::whereIn('option', $opt)
  -&gt;whereIn('value',$val)
  -&gt;where('product_id',$prodId)
  -&gt;pluck('sku')
  -&gt;toArray();
  </code></pre>
  
  <p>the result = [
  "ws52",
  "wsu34",
  "wsu34"
  ]</p>