title: How to perform a Left join clause on a pivot table?
body: <p>How can i add <code>leftJoin</code> clause on the <code>pivot table</code>? For example in the code below, how can i add a <code>where</code> clause in <code>products_categories</code> to specify the <code>products</code> with <code>type='ELECTRONICS'</code> ?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>DB::table("products_categories")
  -&gt;whereIn("category_id", array_values($ids))
  -&gt;pluck("id")
  -&gt;all();</code></pre>
  </div>
  </div>
  </p>