Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Paginator, currently
pageName
can only be a "first-level" query parameter. Some Spechs (i.e. JSON:API) require pagination query parameters to reside under or within thepage
parameter. This might look like?page[size]=5&page[number]=3
orpage[cursor]=123
. Currently this seems not to be possible with Laravel.Using the string
'page[number]'
as pageName results in a query string with doubled parameterpage%5Bnumber%5D
.The reason for this lies in
Illuminate\Pagination\AbstractPaginator::url()
where $parameters is filled with:Neither
Arr::query()
norhttp_build_query()
handle this conflicting situation properly.A simple solution would be, to normalize / flatten the $parameters array before
array_merge()
in theurl()
method. Not sure if this would cause any other issues.Beta Was this translation helpful? Give feedback.
All reactions