- Is lenny4/doctrine-merge-persistent-collection-bundle a Laravel package?
- No. It is a Symfony bundle with a Bundle suffix, DI extension, and service definitions, and it has no Laravel service provider or Eloquent integration. In a Laravel-first stack its packaging fit is effectively zero unless Doctrine ORM has been deliberately introduced.
- How do I install this bundle in a Laravel app?
- There is no normal Laravel installation path. You would have to bypass the bundle layer, instantiate the underlying merge service manually, bind it in a service provider, and thread it through your repository or manager code. That consumes volatile internals rather than the public contract, so copying or adapting the merge logic under MIT attribution is the more defensible route.
- What problem does a merge-persistent Doctrine collection solve?
- It addresses Doctrine's Unit of Work behavior when merging detached entities that carry PersistentCollection associations. The collection is made merge-persistent so state is kept across merges and unexpected orphan removals are reduced. That is a real Doctrine sharp edge, but it is not an Eloquent problem.
- Does this package work with Doctrine ORM 3.x and modern Laravel versions?
- Check composer.json for PHP, doctrine/orm, and symfony/* constraints before assuming compatibility. Doctrine ORM 3.x changed collection and Unit of Work semantics meaningfully, so a small bundle pinned to ORM 2.x may fail at Composer resolution. The likely first blocker is a dependency constraint conflict, not a runtime bug.
- Can I use this bundle with Eloquent instead of Doctrine?
- No. The package changes Doctrine ORM behavior and has no Eloquent integration. If your stack is Laravel plus Eloquent, close the evaluation because the package is out of scope.
- What are the risks of using this package in production?
- The main risk is project health rather than code complexity. Public signals are thin: low adoption, a single maintainer, and no visible CI, coverage, or release cadence from the available metrics. Collection merge bugs can silently duplicate or lose child rows and surface weeks later in reporting or reconciliation, so audit and test before accepting it.
- When would I actually need a merge-persistent collection in Laravel?
- Only when Doctrine ORM is part of the architecture and you can reproduce a failing merge. Look for duplicate children after merge(), orphaned children surviving an update, or a cascade-merge exception on a nested collection. If you cannot reproduce the problem today, you do not need the package.
- Does it have tests for orphanRemoval, cascade merge, ordered collections, and composite keys?
- The available metrics do not prove test coverage. Inspect the repository for tests covering orphanRemoval, cascade persist and merge, ordered collections via @OrderBy, composite keys, and both directions of bidirectional associations. The surface area is small enough to audit fully in a couple of hours, which is the realistic way to de-risk it.
- Should I install it via Composer or copy the merge logic into my app?
- In a Laravel context, copying or adapting the merge logic into app/Support/Doctrine under MIT attribution is the realistic option. A live Composer dependency would require bypassing the Symfony bundle and consuming internals that are likely to change. Treat upstream as reference material unless you have a Symfony application.
- What alternatives exist to this Symfony Doctrine merge bundle?
- Alternatives include in-house collection diffing, manually reattaching PersistentCollection associations, or maintaining a small fork of the merge logic. There is no Laravel-native alternative because the problem is Doctrine-specific. Evaluate maintainer activity and version constraints before depending on any upstream fork.