php - Laravel 5.1 query string parameter not working in pagination -
i using laravel 5.1 pagination. not working. guess problem accessing query string parameter.
routes.php
route::get('blogs', 'front\frontcontroller@blog');
controller
public function blog(request $request) { print_r($request->fullurl()); die; $blogs=blog::with('user')->where('flag','!=','0')->paginate(2); return view('front.pages.blog_list',['blogs'=>$blogs]); }
for url http://localhost/myproject/blogs?page=2
result : http://localhost/myproject/blogs?blogs. should ?page=2 instead of ?blogs. have noticed query string parameters not working in others page. idea? in advance.
use ->appends(\input::except('page'))
return view('front.pages.blog_list',[ 'blogs'=>$blogs->appends(\input::except('page')) ]);
Comments
Post a Comment