Laravel Pagination links not including other GET parameters

前端 未结 12 642
遥遥无期
遥遥无期 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条回答
  •  再見小時候
    2020-12-04 09:04

    EDIT: Connor's comment with Mehdi's answer are required to make this work. Thanks to both for their clarifications.

    ->appends() can accept an array as a parameter, you could pass Input::except('page'), that should do the trick.

    Example:

    return view('manage/users', [
        'users' => $users->appends(Input::except('page'))
    ]);
    

提交回复
热议问题