title: Laravel repository model executing two queries
body: <p>I am trying to implement a criteria model based on this <a href="https://github.com/andersao/l5-repository" rel="nofollow">package</a></p>
  
  <p>If I am pushing the following criteria which does a join and fetches the required coloumns, its suppose to execute a single query. But its executing two queries </p>
  
  <pre><code>select `products`.`product_name`, `skus`.`quantity` from `products` inner join `skus` on `skus`.`products_id` = `products`.`products_id` where `products`.`products_id` = '1'380μshomestead
  
  select * from `products` where `products`.`products_id` = '0' limit 1
  </code></pre>
  
  <p>Why is it executing two queries where I only need to execute the first one?</p>
  
  <p>Code samples as follows</p>
  
  <h2>Controller</h2>
  
  <pre><code>public function __construct(ProductRepository $product_repository){
          $this-&gt;product_repository = $product_repository;
      }
  
      public function all()
      {
          $data = $this-&gt;product_repository-&gt;getByCriteria(new GetProduct());
          $product = $this-&gt;product_repository-&gt;find('1');
  
      }
  </code></pre>
  
  <h2>Criteria Repository</h2>
  
  <pre><code>class getProduct implements CriteriaInterface {
  
      public function apply($model, RepositoryInterface $repository)
      {
          $model = $model
                  -&gt;select('products.product_name', 'skus.quantity')
                  -&gt;where('products.products_id', '1')
                  -&gt;join('skus', 'skus.products_id', '=', 'products.products_id');
          return $model; 
      }
  }
  </code></pre>
  
  <h2>dd($data) yielded the below</h2>
  
  <pre><code>Collection {#300 ▼
    #items: array:2 [▼
      0 =&gt; Product {#301 ▼
        #primaryKey: "products_id"
        #fillable: []
        #connection: null
        #table: null
        #perPage: 15
        +incrementing: true
        +timestamps: true
        #attributes: array:2 [▶]
        #original: array:2 [▶]
        #relations: []
        #hidden: []
        #visible: []
        #appends: []
        #guarded: array:1 [▶]
        #dates: []
        #dateFormat: null
        #casts: []
        #touches: []
        #observables: []
        #with: []
        #morphClass: null
        +exists: true
        +wasRecentlyCreated: false
      }
      1 =&gt; Product {#302 ▼
        #primaryKey: "products_id"
        #fillable: []
        #connection: null
        #table: null
        #perPage: 15
        +incrementing: true
        +timestamps: true
        #attributes: array:2 [▶]
        #original: array:2 [▶]
        #relations: []
        #hidden: []
        #visible: []
        #appends: []
        #guarded: array:1 [▶]
        #dates: []
        #dateFormat: null
        #casts: []
        #touches: []
        #observables: []
        #with: []
        #morphClass: null
        +exists: true
        +wasRecentlyCreated: false
      }
    ]
  }
  </code></pre>