Pagination links being removed when transforming DataCollection #98
-
I was messing around with this package and noticed it removes the links collection provided by Laravel's laravel-data/src/Transformers/DataCollectionTransformer.php Lines 68 to 77 in b1c8975 Is there a way to override this behavior? I'm new to using data objects and API resources in general, so sorry if this is a dumb question 😅. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @bmw27, Good point! This should be fixed in the release later today! |
Beta Was this translation helpful? Give feedback.
-
Hey! I would like to re-open this topic. I have noticed that the links collection is organized differently than how Laravel does it currently. Laravel returns Links full info inside metadata and a short version at the same level of metadata and data: But Laravel-data package returns only full version at the same level of metadata and data: This is a problem because our pagination logic on the frontend is re-used over all endpoints. In most of them, we use pagination as per Laravel's structure. But if we return a collection with the laravel-data package, we need to implement different logic for pagination in the frontend. I think it's interesting to use the same structure as laravel for pagination data. What do you think @rubenvanassche ? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Hi @bmw27,
Good point! This should be fixed in the release later today!