PHPackages                             enfil/laravel-ddd-cqrs-modules - 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. [Framework](/categories/framework)
4. /
5. enfil/laravel-ddd-cqrs-modules

ActiveLibrary[Framework](/categories/framework)

enfil/laravel-ddd-cqrs-modules
==============================

description

01PHP

Since Apr 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/enfil/laravel-ddd-cqrs-modules)[ Packagist](https://packagist.org/packages/enfil/laravel-ddd-cqrs-modules)[ RSS](/packages/enfil-laravel-ddd-cqrs-modules/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

About Package
-------------

[](#about-package)

To decompose the system, it is proposed to identify bounded business logic contexts and separate them into individual modules

Each module should be responsible for one related context and have a defined directory structure that determines the core layers

This package is built on top of [nwidart/laravel-modules](https://github.com/nWidart/laravel-modules) and generates the following module structure:

**Domain - Domain layer**

- Src
- Entity
- UseCase
- Repository
- Service

**Application - Application layer**

- Api
- Service
- Console
- Listener
- Provider

**Infrastructure - Infrastructure layer**

- Config
- Database
- Repository
- ReadModel

**Presentation - Presentation layer**

- Http
    - Controller
    - Request
    - Middleware

**Testing**

Installation
------------

[](#installation)

#### Require packages

[](#require-packages)

```
composer require enfil/laravel-ddd-cqrs-modules codeception/codeception codeception/module-asserts codeception/module-phpbrowser
```

#### Publish the package's configuration

[](#publish-the-packages-configuration)

```
php artisan vendor:publish --provider="Enfil\Laravel\DddCqrs\Modules\LaravelModulesServiceProvider"
```

#### Add this line to composer.json autoload

[](#add-this-line-to-composerjson-autoload)

```
"autoload": {
  "psr-4": {
    ...
    "Modules\\": "modules/",
    ...
  }
},
```

Usage
-----

[](#usage)

As an example, let's take the **Comments** module for comments.

Let's assume that the list of main entities will be as follows:

- **Comment**
- **Author**

### Module generation and CRUD

[](#module-generation-and-crud)

```
module:make-structure {MODULE_NAME} {ENTITY_NAMES*}
```

Let's call the command.

#### Creating a new module

[](#creating-a-new-module)

```
php artisan module:make-structure Comments Comment Author
```

The command should generate the module structure, create the main entities, repository interfaces, read models, services, controllers, requests, configs, migrations, and one route

Now you can go to the endpoint  and see this message:

```
{"data":{"message":"Comment - module index"}}
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/62f48333c3a23d696a7e1edb9f534f957483dc582a3fd7d954d474531078c2f0?d=identicon)[enfil](/maintainers/enfil)

---

Top Contributors

[![enfil](https://avatars.githubusercontent.com/u/6010776?v=4)](https://github.com/enfil "enfil (2 commits)")

### Embed Badge

![Health badge](/badges/enfil-laravel-ddd-cqrs-modules/health.svg)

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

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M298](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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