Skip to content

Conversation

@devajmeireles
Copy link
Contributor

While automaticallyEagerLoadRelationships is still advertised as "Beta", it is available for use - I have personally used it in production and have seen good behavior from it, and for this reason it no longer makes sense to throw the preventsLazyLoad exception when automaticallyEagerLoadingRelationships is enabled.

@taylorotwell taylorotwell merged commit 40edd68 into laravel:12.x May 19, 2025
61 checks passed
@francoism90
Copy link

Wouldn't it still be possible to have a lazy load exception?

I did first define preventsLazyLoad after automaticallyEagerLoadingRelationships for this reason.

It tries to automatically eager relationships, now you completely disable any feedback if it doesn't?

@decadence
Copy link
Contributor

decadence commented May 21, 2025

I don't see much point in this change either. If automaticallyEagerLoadingRelationships is working correctly then the code will not reach this point. If it's wrong in some situations (packages or some complex cases) then we should see the exception but after this change we won't.

automaticallyEagerLoadingRelationships works with preventLazyLoading nicely.

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.

4 participants