Laravel Pagination links not including other GET parameters

前端 未结 12 655
遥遥无期
遥遥无期 2020-12-04 08:35

I am using Eloquent together with Laravel 4\'s Pagination class.

Problem: When there are some GET parameters in the URL, eg: http://site.com/u

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 08:54

    Be aware of the Input::all() , it will Include the previous ?page= values again and again in each page you open !
    for example if you are in ?page=1 and you open the next page, it will open ?page=1&page=2
    So the last value page takes will be the page you see ! not the page you want to see

    Solution : use Input::except(array('page'))

提交回复
热议问题