I have tried to use pagination with laravel and everything works fine until I navigate to another page, then the request doesn't preserve the previous query string and, as a result, the query doesn't work anymore.
This is the query in the controller:
$inputDate =$request->input('date') ;
$endDate = date('Y-m-d', strtotime($inputDate. ' + 7 days'));
$shifts = DB::table('driver_shifts')
->join('drivers','drivers.PermitNumber','=','driver_shifts.driver_badge_id')
->where ('driver_shifts.shift_start_time','>',$inputDate)
->where ('driver_shifts.shift_start_time','<',$endDate)
->orderby("vehicle_id")
->orderby("shift_start_time")
->paginate(20);
return view('reports.WeeklyTaxiShifts.WeeklyTaxiShifts', compact('shifts','inputDate'));