Data Object from LengthAwarePaginator with relationships #1014
Unanswered
chernandezosma
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi,
I'm starting to use this package, and I'm facing a possible issue, although I'm not sure that it will be one.
I've defined a Data for a Category with the same fields that the Category model has, I get all items from the database with
Well, the $dto contains all data, but it has not been structured as the query results. The
collect
method has not returned the data with the relationship for each record (model) as I understood from the documentation and what I expected.Is that an issue, or am I misunderstanding the functionality of the
collect()
method?Is there any way to construct a collection of DTOs from a paginated result, including the related models?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions