@usman
I placed the custom paginator/presenter and the default one on the top of and at the bottom of the table, respectively.
I even hard coded the parameters for the custom one:
{!! with(new App\Http\Presenters\DatatablePaginationPresenter($articles))->appends(['sort' => 'id','order' => 'asc','limit' => '10','term' => 'hello'])->render() !!}
{!! $articles->appends(['sort' => $column,'order' => $order,'limit' => $limit,'term' => $term])->render() !!}
It is very interesting to observe that even I hard coded, the urls generated by custom presenter were still like admin/articles?page=2, admin/articles?page=3 and so on.
appends() did not work in custom presenter.
Back to your question. Pretty sure they have values once user starts to sort by a column or to search. I used the default paginator before by just calling appends() on $articles. It worked well.
If you are curious about where these variables come from, here is the code in controller (for simplicity, let's just set $column):
// Sort by which column?
$column= $request->input('sort');
// and after all the processing, return $column to the view in order to construct links, like pagination
return view('admin/articles/index')->with('column',$column);
$column will be passed to repo/service layer to be used in orderBy(). There is a check:
$column= is_null($column) ? 'id' : $column;
So except for the first time when users visit the article table, once they start to sort by a column, input sort always has a value.
More code in the view, anchors that let users sort by a column:
<th>{{trans('ui.articles.id')}} <a data-toggle="tooltip" data-placement="top" title="{{trans('ui.dataTable.sort')}}" href='{{url("admin/articles?sort=id")}}'></a></th>
<th>{{trans('ui.articles.title')}} <a data-toggle="tooltip" data-placement="top" title="{{trans('ui.dataTable.sort')}}" href='{{url("admin/articles?sort=title")}}'></a></th>
You can see different anchors set a value to 'sort' differently.