title: Laravel 4.2 Pagination with complex DB query
body: <p>I am new to Laravel 4.2.</p>
  <p>I need to do some pagination in my view search result page.</p>
  <p>What I am doing is writing this code in the controller -</p>
  <pre><code>public function getSpecials()
  {
      $title = &quot;Specials&quot;;
  
      
      $info = DB::table(DB::raw('`car` , `available_car`, `users`'))
                          -&gt;select('car.car_maker', 'car.car_model', 'available_car.car_price', 'car.car_production_year', 'available_car.car_id', 'available_car.id', 'available_car.current_position')
                          -&gt;where('available_car.car_id', '`car`.`car_id`')
                          -&gt;where('available_car.is_sold', 'no')
                          -&gt;whereRaw('`available_car`.`created_at` BETWEEN NOW() - INTERVAL 30 DAY AND NOW()')
                          -&gt;orderByRaw('WEEK(`available_car`.`created_at`) DESC')
                          -&gt;orderBy('available_car.car_price', 'desc')
                          -&gt;orderBy('users.last_paid_date', 'desc')
                          -&gt;orderBy('available_car.created_at', 'desc')
                          -&gt;distinct()
                          -&gt;get();
  
      $pagination = Paginator::make($info, count($info), 5);
  
  
      //var_dump($pagination );
      
      
      return View::make('specials',compact('pagination'))-&gt;with('info',$info)-&gt;with('title',$title);
  }
  </code></pre>
  <p>I want to show 5 items per page. So I am doing paginate like this -</p>
  <pre><code>$pagination = Paginator::make($info, count($info), 5);
  </code></pre>
  <p>But the problem here is I am getting paginate number in the page perfectly.
  But, All page is showing the whole result, not showing only 5 items.</p>
  <p>It is the output. (paginate is for 5 items per page and total no of entry is 7 in my case)</p>
  <p><img src="https://i.stack.imgur.com/8Nxmw.jpg" alt="First Page" /></p>
  <h2>Page 1</h2>
  <p><img src="https://i.stack.imgur.com/l5f3c.jpg" alt="Second Page" /></p>
  <h2>Page 2</h2>
  <p>Can anyone help me please?
  Thanks in advance for helping.</p>