A Symfony bundle that automates the generation of Domain-Driven Design (DDD) code artifacts, including commands, queries, handlers, controllers, API documentation, tests, and more. This bundle provides console commands to quickly scaffold DDD classes for your Symfony projects, following the CQRS (Command Query Responsibility Segregation) pattern.
If you're developing locally, add a path repository in your project's composer.json:
{
"repositories": [
{
"type": "path",
"url": "../ddd-maker-bundle"
}
],
"require": {
"cnd/ddd-maker-bundle": "*"
}
}
Then run:
composer require cnd/ddd-maker-bundle --dev
If you are using Symfony Flex, the bundle is auto-registered. Otherwise, add the following to your config/bundles.php:
return [
// ...
Cnd\DddMakerBundle\DddMakerBundle::class => ['all' => true],
];
Run the following command to see the available DDD generator commands:
php bin/console list make
To generate a complete CQRS structure for an entity, use:
php bin/console make:ddd-full YourEntity
⚠️ Note: The entity must exist in App\Entity\YourEntity and have constructor and getters / setters.
To generate a query and its handler:
php bin/console make:ddd-query YourEntity QueryName Parameter
### 3. Generate a Command
To generate a command and its handler:
```bash
php bin/console make:ddd-command YourEntity Action
After running the commands, you can check the generated structure:
php bin/console make:ddd-full Wallet --force false
php bin/console make:ddd-command Wallet UpdatePhone
php bin/console make:ddd-query Wallet find phoneNumber
http://127.0.0.1:8000/api/docs
php bin/phpunit
How can I help you explore Laravel packages today?