Ich habe eine SQL-Suche, wo ich Eloquent whileRaw verwenden, und dann paginatate Ergebnisse.Laravel where Anweisung und Seitennummerierung
Proplem: die Ergebnisse werden paginiert und wenn ich zur nächsten Seite navigiere, werden die Ergebnisse weg sein und es wird nur "ALLE AUSWÄHLEN", denn Laravels Seitennummerierung sendet nur? Page = GET-Anfrage.
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') && Input::has('price_max')) {
$query .= ' and price < '.Input::get('price_max').' and price >'.Input::get('price_min');
}
$listings = ListingDB::whereRaw($query)->paginate(5);
return View::make('page.index')->with('title','Home')->with('listings',$listings);
so, wenn ich auf der nächsten Seite navigieren alle Eingabe weg ist, weil Laravel Paginierung erzeugt nur mit page = Variable GET, wie kann ich es lösen?
danke.