becklyn/ddd-core and becklyn/ddd-doctrine-bridge), enabling:
Symfony\Component\DependencyInjection).fruitcake/laravel-doctrine).kernel overhead.composer require with no Laravel-specific conflicts.*Subscriber, *Handler) align with Symfony’s conventions.fruitcake/laravel-doctrine) supports the event store migrations.AggregateIdParamConverter) assume Symfony’s request handling. Laravel would need custom middleware or converters.migrations:run vs. Symfony’s doctrine:migrations:migrate).BackedEnumNormalizer. Custom serializers may be needed.| Risk Area | Severity | Mitigation |
|---|---|---|
| Symfony-Laravel DI Conflicts | Medium | Use Laravel’s Symfony\DependencyInjection facade or isolate DDD services in a sub-container. |
| Doctrine Migration Issues | High | Test migrations in a Laravel environment; use fruitcake/laravel-doctrine for compatibility. |
| Event Bus Latency | Low | SimpleBus is synchronous by default; async support requires additional middleware (e.g., Symfony\Component\Messenger). |
| Enum Serialization | Medium | Override Symfony’s normalizers with Laravel-compatible versions. |
| Lack of Laravel Docs | High | Build internal runbooks for Laravel-specific configurations (e.g., Artisan commands for event store). |
| Vendor Lock-in | Low | Core DDD patterns (events, commands) are portable; only SimpleBus/Doctrine integrations are locked. |
DDD Maturity:
Laravel-Symfony Hybrid:
Performance:
Symfony\Component\Messenger for async.)Long-Term Maintenance:
spatie/laravel-event-sourcing, asgrim/laravel-event-sourcing) that better fit Laravel’s native patterns?Testing:
| Laravel Component | Package Integration | Compatibility Notes |
|---|---|---|
| Service Container | Uses Symfony’s DI under the hood; Laravel’s container is compatible via symfony/dependency-injection. |
Avoid conflicts by namespacing DDD services (e.g., App\Ddd\). |
| Doctrine ORM | Requires fruitcake/laravel-doctrine for Laravel integration. |
Event store migrations must be adapted for Laravel’s Schema builder. |
| Event System | Laravel’s events can dispatch to SimpleBus’s event bus via a listener. | Custom event mapper needed to convert Laravel’s Illuminate\Events\Dispatcher to SimpleBus. |
| Routing/HTTP | Symfony’s AggregateIdParamConverter may not work natively; use Laravel’s route model binding. |
Create custom middleware to bridge Symfony’s converters to Laravel’s. |
| Artisan Commands | Package provides Symfony-style CLI commands (e.g., doctrine:migrations:migrate). |
Override or alias commands in app/Console/Kernel.php. |
| Validation | Uses Symfony’s validator; Laravel’s Illuminate\Validation can coexist. |
No conflicts if DDD validation is scoped to domain layers. |
| Caching | Doctrine cache is optional; Laravel’s cache (Redis/Memcached) can be configured. | Replace doctrine/cache with Laravel’s cache adapter. |
Phase 1: Proof of Concept (2–4 weeks)
Order domain).becklyn/ddd-symfony-bridge, becklyn/ddd-core, and becklyn/ddd-doctrine-bridge.fruitcake/laravel-doctrine.Order) with events and commands.Phase 2: Core Integration (4–8 weeks)
SimpleBus bundles in Laravel’s config/bundles.php (or equivalent).*Subscriber, *Handler).Phase 3: Full Adoption (8–12 weeks)
OrderCreated instead of created: order).How can I help you explore Laravel packages today?