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

[10.x] Call makeSearchableUsing before searching on CollectionEngine #777

Merged
merged 1 commit into from
Oct 30, 2023
Merged

[10.x] Call makeSearchableUsing before searching on CollectionEngine #777

merged 1 commit into from
Oct 30, 2023

Conversation

Magnesium38
Copy link
Contributor

Other engines (asides from the Database engine) call makeSearchableUsing as part of importing the data, giving them the chance to eager load relationships and such. The Collection engine never has this opportunity since they are never imported. In the case of Models being strict, toSearchableArray being called individually several times in a row can then cause a LazyLoadingViolationException.

Instead, the Collection engine should have the opportunity to make the models searchable before doing its search.

@driesvints driesvints changed the title CollectionEngine - Call makeSearchableUsing Before Searching [10.x] Call makeSearchableUsing before searching on CollectionEngine Oct 30, 2023
@taylorotwell taylorotwell merged commit 91b0051 into laravel:10.x Oct 30, 2023
7 checks passed
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