- Can this bundle work with Laravel instead of Symfony?
- No, this bundle is specifically designed for Symfony 6.4/7.x and leverages Symfony Maker components. Laravel developers would need to adapt the architecture manually or explore Laravel-specific alternatives like Laravel Hexagonal or similar packages.
- How do I generate a domain entity with this bundle?
- Run `bin/console make:hexagonal:entity domain/module EntityName --aggregate-root` in your Symfony project. This creates a pure PHP domain entity, value objects, and repository interfaces while enforcing Hexagonal Architecture principles.
- Does this bundle support Laravel’s Eloquent ORM?
- No, this bundle is built for Doctrine ORM in Symfony. Laravel’s Eloquent ORM would require customization or a different package. The domain entities remain pure PHP, but the generated repositories are Doctrine-specific.
- What Laravel versions are supported?
- This bundle is not designed for Laravel—it’s for Symfony 6.4/7.x. For Laravel, you’d need to evaluate alternatives like Laravel Hexagonal or manually implement Hexagonal Architecture using Laravel’s ecosystem.
- How does this bundle handle CQRS in Laravel?
- Since this bundle is Symfony-focused, it won’t integrate directly with Laravel’s CQRS implementations. However, you could manually adopt its CQRS principles (commands, queries, handlers) in Laravel using packages like Spatie’s Laravel CQRS or custom solutions.
- Is there a way to customize the generated YAML configurations?
- Yes, the bundle uses YAML for mapping (e.g., Doctrine configurations), and you can manually edit these files after generation. However, complex customizations may require extending the bundle’s templates or writing custom makers.
- Can I use this bundle in a greenfield Laravel project?
- No, this bundle is not compatible with Laravel. For a greenfield Laravel project, consider alternatives like Laravel Hexagonal or manually structuring your project with Ports & Adapters using Laravel’s service containers and repositories.
- How does testing work with this bundle?
- The bundle generates test classes (e.g., use-case tests) compatible with Symfony’s testing tools like `KernelTestCase`. In Laravel, you’d need to adapt these patterns to Laravel’s testing tools like `PHPUnit` with `createApplication()` or `Http` tests.
- Are there alternatives for Laravel that provide similar Hexagonal Architecture support?
- Yes, for Laravel, consider packages like `laravel-hexagonal`, `spatie/laravel-cqrs`, or `nWidart/laravel-modules` for modular architecture. These packages offer Laravel-specific implementations of Hexagonal Architecture, CQRS, and modular design.
- What’s the best way to migrate an existing Laravel app to Hexagonal Architecture?
- Start by refactoring your domain logic into pure PHP entities and interfaces, then gradually introduce Ports & Adapters. Use Laravel’s service providers to decouple business logic from frameworks. Avoid forcing the bundle’s Symfony-specific generators—adapt the principles instead.