How to automatically append query string to laravel pagination links?

后端 未结 9 1997
失恋的感觉
失恋的感觉 2020-12-01 06:06

I am working on search filter on checkbox click, with Laravel and Ajax call. So I get results when I click on a checkbox. my query is as follows:

    $editor         


        
9条回答
  •  既然无缘
    2020-12-01 06:52

    For the latest version of Laravel at the moment (5.2), you can just use the Request facade to retrieve the query string and pass that to your paginator's appends() method

    $input = Request::input();
    $myModelsPaginator = App\Models\MyModel::paginate();
    $myModelsPaginator->appends($input);
    

提交回复
热议问题