Skip to content

Add Builder On Clone callback support#54477

Merged
taylorotwell merged 5 commits into
laravel:11.xfrom
ralphjsmit:rjs/add-on-clone-callbacks
Feb 6, 2025
Merged

Add Builder On Clone callback support#54477
taylorotwell merged 5 commits into
laravel:11.xfrom
ralphjsmit:rjs/add-on-clone-callbacks

Conversation

@ralphjsmit

Copy link
Copy Markdown
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
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