title: Laravel where statement and pagination
body: <p>I have an SQL search where I use Eloquent whereRaw, and than paginatate results.</p>
  
  <p><strong>Proplem:</strong> the results are paginated and if I navigate to the next page the results will  be gone and it will just "SELECT All " bacause laravel's pagination sends only ?page= GET request. </p>
  
  <p>code: </p>
  
  <pre><code>if (Input::has('city')) {
          $query .= ' and city = '.Input::get('city');
      }
      if (Input::has('area')) {
          $query .= ' and area = '.Input::get('area');
      }
      if (Input::has('sub_location')) {
          $query .= ' and sub_location = '.Input::get('sub_location');
      }
      if (Input::has('rent')) {
          $query .= ' and rent = '.Input::get('rent');
      }
      if (Input::has('price_min') &amp;&amp; Input::has('price_max')) {
          $query .= ' and price &lt; '.Input::get('price_max').' and price &gt;'.Input::get('price_min');
      }
  
  
      $listings = ListingDB::whereRaw($query)-&gt;paginate(5);
  
  
      return View::make('page.index')-&gt;with('title','Home')-&gt;with('listings',$listings);
  </code></pre>
  
  <p>so when I navigate to the next page all the Input is gone because laravel generates pagination only with ?page= GET variable, how can I solve it?</p>
  
  <p>thank you.</p>