Replies: 1 comment
-
I found the following solution: Works well and should be stable for now. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently (v8.x), the JSON response, when LengthAwarePaginator is used is like this:
{ "data": [], "links": { ... } "meta": { "current_page": 1, ... "links": [ { "url": ..., "label": ..., "active": ... } ] ... } }
While I understand the purpose of meta.links property, sometimes it might be very long (e.g. hundreds of pages available). Or maybe someone just don't need them.
I can't find an easy and elegant way to remove them from the response, except overwriting ResourceCollection method toResponse() to modify the final JSON response.
Would be nice if this property is optional.
Maybe there should be some JsonResource->without() method, similar to with().
Beta Was this translation helpful? Give feedback.
All reactions