title: How to make where-filter in “With” (ManyToMany Laravel)?
body: <p>Relationship ManyToMany.
  I'm trying to make a request:</p>
  
  <pre><code>$products=Product::with(['lists' =&gt; function($query)
                  {
             $query-&gt;where('user_id', Auth::id());
                  }])
                  -&gt;orderBy('id', 'desc')
                  -&gt;paginate(20);
  </code></pre>
  
  <p>But I get an error.</p>
  
  <pre><code>"SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'user_id' in where clause is ambiguous (SQL: select `mainlists`.*, `list_products`.`product_id` as `pivot_product_id`, `list_products`.`list_id` as `pivot_list_id` from `mainlists` inner join `list_products` on `mainlists`.`id` = `list_products`.`list_id` where `user_id` = 16 and `list_products`.`product_id` in (73, 80, 81, 87, 88, 89)
  </code></pre>
  
  <p>These relationships work correctly in a variety of other queries. 
  I think my request is incorrect for the type of relationship ManyToMany.
  Because the query is trying to compare multiple products with an pivot table. </p>