byteincoffee/doctrine-extensions-bundle
doctrine/orm (e.g., via laravel-doctrine or illuminate/database polyfills). If the project already uses Doctrine, this bundle could reduce boilerplate for common extensions.symfony/dependency-injection or symfony/http-kernel).HasMany, SoftDeletes) that overlap with this bundle’s capabilities. Justification for adoption would require specific unsupported use cases (e.g., advanced translatable fields with custom logic).fsi/doctrine-extensions (core library)doctrine/orm (v2.x)symfony/framework-bundle (for bundle registration).
Risk: Laravel’s autoloader (ComposerAutoloader) may conflict with Symfony’s bundle system unless isolated (e.g., via a vendor/bin hack or custom PSR-4 mapping).config.yml) and listener registration, which Laravel typically handles via service providers or Eloquent events. Migration would require:
Extension system in Laravel (e.g., via ServiceProvider boot methods).config/doctrine.php or environment variables.@ORM\, @FSi\), but Laravel’s Eloquent primarily uses PHP 8 attributes or fluent methods. Conflict: Annotations would need to be converted or coexist (e.g., via doctrine/annotations library).ServiceProvider model doesn’t natively support Symfony’s Bundle lifecycle (e.g., preLoad, postLoad). Workarounds include:
symfony/http-kernel as a micro-framework within Laravel (high complexity).UploadableTrait, TranslatableListener) and integrating via Laravel’s event system.doctrine/orm (if used) might be on a different branch. Risk: Breaking changes or missing features.Container and EventDispatcher.Why Not Eloquent?
Doctrine Adoption Commitment
Alternative Solutions
spatie/laravel-translatable, spatie/laravel-medialibrary) replace the bundle’s functionality with lower integration risk?doctrine-extensions?Configuration Management
config.yml settings be mapped to Laravel’s config/? (e.g., via config/doctrine.php or environment variables?)Performance Impact
doctrine/orm (v2.x) + doctrine/annotations (for annotation support).symfony/dependency-injection (optional, for DI container compatibility).symfony/event-dispatcher (if using Symfony’s event system).| Step | Action | Tools/Libraries | Risk |
|---|---|---|---|
| 1 | Assess Scope | Review bundle features vs. Eloquent capabilities. | Low |
| 2 | Dependency Setup | Add fsi/doctrine-extensions, doctrine/orm, doctrine/annotations to composer.json. |
Medium (version conflicts) |
| 3 | Doctrine Integration | Configure doctrine/orm in Laravel via config/doctrine.php (use laravel-doctrine/orm if available). |
High (Doctrine setup complexity) |
| 4 | Symfony Bridge | Create a DoctrineExtensionsServiceProvider to: - Register Symfony-style listeners. - Map config.yml to Laravel’s config. |
High (custom logic required) |
| 5 | Entity Migration | Convert annotated entities to: - PHP 8 attributes (if using Doctrine 2.10+). - ORM XML/YAML (if annotations are mandatory). | Medium (refactoring effort) |
| 6 | Event Listeners | Replace Symfony’s EventDispatcher with Laravel’s Events system or a hybrid approach. |
Medium (event mapping) |
| 7 | Testing | Write integration tests for: - Translatable/Uploadable behaviors. - Doctrine-Laravel hybrid queries. | High (complex test setup) |
fsi/doctrine-extensions ~ doctrine/orm).symfony/dependency-injection, ensure no conflicts with Laravel’s Illuminate/Container.doctrine/orm’s attribute support (e.g., [ORM\Table] instead of annotations).FSiAssert constraints. Replace with Laravel’s Illuminate\Validation or symfony/validator.Translatable) in a single entity to validate integration.Uploadable traits) without the Symfony bundle wrapper.composer.json complexity and potential for version lock conflicts.config.yml and Laravel’s config introduces human error risk.fsi/doctrine-extensions (unmaintained) may require forking or rewriting if issues arise.Bundle system with Laravel’s ServiceProvider calls.Model lifecycle (e.g., saved(), deleting()).How can I help you explore Laravel packages today?