Skip to content

feat: allow limiting ToMany relationships#102

Closed
SychO9 wants to merge 2 commits intotobyzerner:mainfrom
SychO9:sm/limit-tomany
Closed

feat: allow limiting ToMany relationships#102
SychO9 wants to merge 2 commits intotobyzerner:mainfrom
SychO9:sm/limit-tomany

Conversation

@SychO9
Copy link
Copy Markdown
Contributor

@SychO9 SychO9 commented Feb 28, 2024

The https://github.com/staudenmeir/eloquent-eager-limit package allows limiting relationship results, Laravel 11 will officially support this: laravel/framework#49695.

This PR adds support for the feature, allowing ToMany relationships to be limited by simply passing ->limit(6), this is especially useful when all that's needed is a subset of results, which is a great performance improvement.

@SychO9
Copy link
Copy Markdown
Contributor Author

SychO9 commented Mar 1, 2024

hmm, would be smarter to just allow constraining the query. #103

@SychO9 SychO9 closed this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant