myclabs/deep-copy
DeepCopy creates safe deep clones of PHP objects, recursively copying referenced objects while preserving the original object graph. It handles cyclic references to avoid infinite loops, and supports customization via matchers and filters for specific properties and types.
Create deep copies (clones) of your objects
How can I help you explore Laravel packages today?