Skip to content

Conversation

@ralphjsmit
Copy link
Contributor

I noticed that when the Eloquent Builder is cloned, it will not clone the internal Eloquent model. This can be problematic for a package like kirschbaum-development/eloquent-power-joins, which depends with a cache on the spl_object_id() of the Eloquent model in the query.

This PRs adds a simple onClone() callback that will be called anytime a Builder is cloned, leaving open more advanced options for these more advanced Eloquent packages.

Thanks!

@ralphjsmit ralphjsmit changed the title Add Builder On Clone callbacks Add Builder On Clone callback support Feb 5, 2025
@taylorotwell taylorotwell merged commit a254dbd into laravel:11.x Feb 6, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants