I am using Eloquent together with Laravel 4's Pagination class.
Problem: When there are some GET parameters in the URL, eg: http://site.example/users?gender=female&body=hot
, the pagination links produced only contain the page
parameter and nothing else.
Blade Template
{{ $users->link() }}
There's a ->append()
function for this, but when we don't know how many of the GET parameters are there, how can we use append()
to include the other GET parameters in the paginated links without a whole chunk of if
code messing up our blade template?