title: How to use pagination in laravel 5 with Raw query
body: <p>I have a simple question and I didn´t find what I need.</p>
  
  <p>I need to calculate the distance between t2 geocode points for a list of Stores. I also need it to be paginated for a WebService.</p>
  
  <p>This works, but there is no distance in the result:</p>
  
  <pre><code>public function stores(){
      return Store::paginate(10);
  }
  </code></pre>
  
  <p>And the result is: </p>
  
  <pre><code>{
     total: 4661, 
     per_page: 10, 
     current_page: 6, 
     last_page: 467,
     next_page_url: "WS_URL/stores/?page=7",
     prev_page_url: "WS_URL/stores/?page=5", from: 51,
     to: 60, 
     data: [ { 
          id: "51", 
          name: "Sprouts",
          .
          .
          lng: "-118.359688", 
          lat: "33.808281", 
          country: "usa" 
          },
      .
      .
      .
      ]}
  </code></pre>
  
  <p>But I need this code working: </p>
  
  <pre><code>public function stores(){
      return DB::table('stores')
          -&gt;selectRaw(' *, distance(lat, ?, lng, ?) as distance ')
          -&gt;setBindings([ 41.123401,1.2409893])
          -&gt;orderBy('distance')
          -&gt;paginate($this-&gt;limit);
  }
  </code></pre>
  
  <p>And this is the result:</p>
  
  <pre><code>{total: 0,
      per_page: 10,
      current_page: 1,
      last_page: 0,
      next_page_url: null,
      prev_page_url: null,
      from: 1,
      to: 10,
      data: [{
          id: "3686",
          name: "Bon Area", 
          .
          .
          lng: "1.602016",
          lat: "41.266823",
          distance: "0.15091"
          },
      .
      .
      .
      ]
  }
  </code></pre>
  
  <p>I need the <code>next_page_url</code> and <code>prev_page_url</code></p>
  
  <p>Any ideas?</p>