Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Deep Copy Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: DeepCopy integrates seamlessly with Laravel's Eloquent ORM for deep cloning complex object graphs, especially where Laravel's native clone is insufficient. It handles cycles in relationships (e.g., parent-child models) and supports custom filtering for ID resetting or relationship management. However, Laravel's Eloquent-specific magic (e.g., dynamic properties) may require custom filter configuration since the package doesn't natively understand Eloquent's internal state.

Integration feasibility: High. Composer installation is trivial (composer require myclabs/deep-copy), and the API is simple (DeepCopy::copy($object)). Integration requires minimal code changes but careful filter configuration for Laravel-specific scenarios (e.g., resetting IDs, handling relationships). Doctrine-specific filters are unnecessary for pure Eloquent projects but useful if Doctrine is used alongside Laravel.

Technical risk: Low to moderate. The package is actively maintained (recent PHP

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport