title: Use DISTINCT on joined columns with Laravel Query builder
body: <p>I've got two tables products and artifacts who are in a one-to-many-relationship to each other.</p>
  
  <p>Now I'd like to query a few artifacts joined with the products-data.
  This works very good like this:</p>
  
  <pre><code>$artifacts = Artifact::with('product')-&gt;get();
  </code></pre>
  
  <p>However now I'd like to use the DISTINCT command and select the necessary fields to consider with DISTINCT from both tables. Sadly all joined columns fail.</p>
  
  <pre><code>$artifacts = Artifact::with('product')-&gt;select('product.organization, revision')-&gt;distinct()-&gt;get();
  </code></pre>