PHPackages                             ldaidone/laravel-ddd-commands - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ldaidone/laravel-ddd-commands

ActiveLibrary

ldaidone/laravel-ddd-commands
=============================

A lightweight toolkit that adds Domain-Driven Design scaffolding to any Laravel project. Generate domains, use cases, entities, value objects, repositories, and more with expressive artisan commands — keeping your architecture clean and consistent with zero friction.

v0.1.1(5mo ago)1181Apache-2.0PHPPHP &gt;=8.1CI passing

Since Nov 23Pushed 5mo agoCompare

[ Source](https://github.com/ldaidone/laravel-ddd-commands)[ Packagist](https://packagist.org/packages/ldaidone/laravel-ddd-commands)[ RSS](/packages/ldaidone-laravel-ddd-commands/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (5)Used By (1)

📦 Laravel DDD Commands
----------------------

[](#-laravel-ddd-commands)

A lightweight toolkit that adds Domain-Driven Design scaffolding to any Laravel project. Generate domains, use cases, entities, value objects, repositories, events, aggregates, DTOs, actions, and more with expressive artisan commands using the pattern `/` — keeping your architecture clean and consistent with zero friction.

 [![License](https://camo.githubusercontent.com/b29de0acdfd19013f1f02689b15c933e4a6c145be9efa718288f88ba3280b1c5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667)](LICENSE) [![Tests](https://github.com/ldaidone/laravel-ddd-commands/actions/workflows/tests.yml/badge.svg)](#) [![Coverage](https://camo.githubusercontent.com/3b2a240d7213d81d0fb62f434a600e243f389c5330512443cb8472507040d32d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6c646169646f6e652f6c61726176656c2d6464642d636f6d6d616e64733f7374796c653d666c61742d737175617265)](#) [![Packagist](https://camo.githubusercontent.com/2eedbc2900393e322e218a643b42447c38397dbf76b9e4f23aeb7b03ab52a213/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c646169646f6e652f6c61726176656c2d6464642d636f6d6d616e64732e737667)](https://packagist.org/packages/ldaidone/laravel-ddd-commands) [![Downloads](https://camo.githubusercontent.com/dcf1a121b4ea241766fc4524d90d47bb154089baae33e8d7bd766fffaa8de40a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c646169646f6e652f6c61726176656c2d6464642d636f6d6d616e64732e737667)](https://packagist.org/packages/ldaidone/laravel-ddd-commands)

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/leodaido)

---

### ✨ Features

[](#-features)

- 🔧 Generate domains, use cases, entities, value objects, repositories, events, aggregates, DTOs, commands, queries, and actions
- ⚡ Works in any Laravel project (no special folder structure required)
- 🧩 Consistent naming convention: `/` for all generators
- 🧩 Fully configurable namespace &amp; path mappings
- 📁 Ships with clean, extensible stub templates for all generators
- 🧱 Encourages modular, maintainable DDD architecture
- 🚀 Zero learning curve — powered entirely through artisan commands

---

### 🏗 About the Folder Structure (Important)

[](#-about-the-folder-structure-important)

As of **v0.1.1**, the package **no longer uses configuration files or dynamic paths**.

This is an intentional design choice.

#### Why?

[](#why)

Because dynamic paths introduce architectural drift. For DDD, structure must be **stable, predictable, enforceable**, and the same across dev machines, CI runners, and Testbench environments.

The generators now follow a single, consistent convention:

```
app/
└── Domain/
    └── Billing/
        ├── Entities/
        ├── ValueObjects/
        ├── DataTransferObjects/
        ├── UseCases/
        ├── Actions/
        ├── Repositories/
        └── Events/
```

This improves:

- maintainability
- discovery
- onboarding
- large-scale refactors
- automated testing consistency

No config required. No hidden layer. No dynamic directories.

---

### 📦 Installation

[](#-installation)

```
composer require ldidone/laravel-ddd-commands
```

Laravel auto-discovers the service provider — no configuration needed.

---

### ▶️ Usage

[](#️-usage)

> **Important:** All generators follow the format `/`, where `domain_name` corresponds to a domain folder and `element_name` is the name of the element you want to create.

#### Create a domain

[](#create-a-domain)

```
php artisan ddd:create-domain Billing
```

#### Create a use case

[](#create-a-use-case)

```
php artisan ddd:create-use-case Billing/RegisterUser
```

#### Create an entity

[](#create-an-entity)

```
php artisan ddd:create-entity Billing/User
```

#### Create a value object

[](#create-a-value-object)

```
php artisan ddd:create-value-object Billing/Email
```

#### Create a repository

[](#create-a-repository)

```
php artisan ddd:create-repository Billing/UserRepository
```

#### Create a domain event

[](#create-a-domain-event)

```
php artisan ddd:create-event Billing/UserRegistered
```

#### Create an aggregate

[](#create-an-aggregate)

```
php artisan ddd:create-aggregate Billing/Order
```

#### Create a DTO (Data Transfer Object)

[](#create-a-dto-data-transfer-object)

```
php artisan ddd:create-dto Billing/UserDto
```

#### Create a command

[](#create-a-command)

```
php artisan ddd:create-command Billing/RegisterUser
```

#### Create a query

[](#create-a-query)

```
php artisan ddd:create-query Billing/GetUserById
```

#### Create an action

[](#create-an-action)

```
php artisan ddd:create-action Billing/SendEmail
```

#### List available commands

[](#list-available-commands)

```
php artisan list ddd
```

---

### 🧪 Running Tests

[](#-running-tests)

```
composer test
```

If you're using Pest or PHPUnit, the workflow will handle it automatically.

---

### 📊 Test Coverage

[](#-test-coverage)

If using Codecov:

```
vendor/bin/phpunit --coverage-clover=coverage.xml
```

GitHub Actions will upload coverage after each test run.

---

### 📚 Roadmap

[](#-roadmap)

- Aggregate root generator
- Domain event generator
- DTO generator
- Action generator
- CQRS mode (command/query separation)
- Repository implementation generator (Eloquent/Query Builder)

---

Support
-------

[](#support)

If this saves you time or helps your project, consider starring ⭐ and consider [buying me a coffee](https://www.buymeacoffee.com/leodaido)! ☕️ — it keeps the ideas flowing!

---

### 🤝 Contributing

[](#-contributing)

Pull requests are welcome. Please open an issue first for major changes. Make sure to update tests as needed.

---

### 📚 Changelog

[](#-changelog)

See [CHANGELOG.md](CHANGELOG.md)

---

### 📄 License

[](#-license)

Released under the [Apache 2.0 license](LICENSE).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance70

Regular maintenance activity

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bd0f2bae2cfbb34ebb1e5baeb9003c5469b6e67c824e8dcd5d68ca38d904118?d=identicon)[ldaidone](/maintainers/ldaidone)

---

Top Contributors

[![ldaidone](https://avatars.githubusercontent.com/u/1054693?v=4)](https://github.com/ldaidone "ldaidone (26 commits)")

---

Tags

laravelscaffoldingartisanDomain Driven Designddd

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ldaidone-laravel-ddd-commands/health.svg)

```
[![Health](https://phpackages.com/badges/ldaidone-laravel-ddd-commands/health.svg)](https://phpackages.com/packages/ldaidone-laravel-ddd-commands)
```

###  Alternatives

[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
