This was answered for me on another forum. Here is the answer using with a dynamic WHERE clause.
That works perfectly! Thank you very much for your time! For anyone that may find this code in the future, here is how to do the pagination after the query call using append() to send additional values
$query = DB::table('tableName');
if(Input::has('someinput')) {
$query->where('someinput', Input::get('someinput'));
}
if(Input::has('otherinput')) {
$query->where('otherinput', Input::get('otherinput'));
}
$results = $query->paginate(50);
$pagination = $results->appends(array('value' => 'key'));
return View::make('view', array('results' => $results, 'pagination' => $pagination));
Then to display the pagination in your view simple echo the $pagination variable.
//standard syntax
<?php echo $pagination; ?>
//blade syntax
{{ $pagination }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community