title: laravel whereHas include no relation
body: <p>How can i query relationship and still include models that has no relationships? There are two models</p>
  
  <ul>
  <li><p>Store</p></li>
  <li><p>Product</p></li>
  </ul>
  
  <p>code</p>
  
  <pre><code>// Store
  public function products() {
     $this-&gt;belongsToMany('App\Store');
  }
  
  // Product
  public function stores() {
     $this-&gt;belongsToMany('App\Product');
  }
  </code></pre>
  
  <p>and a pivot table to connect them called <code>product_store</code>. Some stores don't have any products. How do i query all products, even those who doesn't belong to any store like:</p>
  
  <p><code>Product::where('store.id', '=', 1)-&gt;get()</code></p>
  
  <p>this is how i currently do it. </p>
  
  <pre><code>Product::whereHas('stores', function($query) {
      $query-&gt;where('id', '=', $store_id);
  });
  </code></pre>
  
  <p>but as the <a href="https://laravel.com/docs/5.3/eloquent-relationships#querying-relations" rel="noreferrer">laravel docs mention</a> this</p>
  
  <blockquote>
    <p>Retrieves all products with at least one store</p>
  </blockquote>