How to Enable Relationship Autoloading in Versions Before v12.8

A few days ago, Litvinchuk added the method withRelationshipAutoloading in PR #53655. As explained in the merge description, it checks the relationships you're calling and applies Auto Eager Loading to them. Of course, this method only exists in v12.8, so I decided to add it to earlier versions in case I work on a project that uses a version before that.

Apr 11, 2025 - 13:09
 0
How to Enable Relationship Autoloading in Versions Before v12.8

automatic-relation-loading-eager-loading

A few days ago, Litvinchuk added the method withRelationshipAutoloading in PR #53655. As explained in the merge description, it checks the relationships you're calling and applies Auto Eager Loading to them. Of course, this method only exists in v12.8, so I decided to add it to earlier versions in case I work on a project that uses a version before that.