Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to limit portal results when using the Eloquent query builder #74

Closed
wants to merge 2 commits into from

Conversation

tkuijer
Copy link

@tkuijer tkuijer commented Jul 10, 2024

This PR adds the ability to increase the amount of returned portal records when using the Eloquent builder. This allows the user to have more then the default of 50 records returned when using the FMModel.

For example;
we have a layout 'Users' with a portal 'LogEntries' containing 100 lines. With the current version it is not possible to retrieve all log entries when having the User as an FMModel instance, since this always returns the default limit of 50 related records.

When this PR gets merged, we can instead chain the limitPortal method when retrieving a user and get all the logentries like this:

$user = User::query()->limitPortal('LogEntries', 200)->first();

@likeadeckofcards
Copy link
Member

Hello @tkuijer Thank you for this PR. This functionality should work without adding the method to the FMEloquentBuilder class. Laravel's EloquentBuilder class, which we are extending, already has logic to forward all method calls for which the method does not exist in the EloquentBuilder class to the base QueryBuilder class.

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.

2 participants