PHPackages                             hitech/ddd-modular-toolkit - 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. hitech/ddd-modular-toolkit

ActiveLibrary[Framework](/categories/framework)

hitech/ddd-modular-toolkit
==========================

A Laravel DDD Modular Toolkit for feature-based architecture.

v1.1.13(6mo ago)32.9k1[1 issues](https://github.com/dhank77/ddd-modular/issues)[1 PRs](https://github.com/dhank77/ddd-modular/pulls)MITPHPPHP ^8.1

Since Jun 19Pushed 6mo agoCompare

[ Source](https://github.com/dhank77/ddd-modular)[ Packagist](https://packagist.org/packages/hitech/ddd-modular-toolkit)[ RSS](/packages/hitech-ddd-modular-toolkit/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (3)Versions (16)Used By (0)

🛠️ Toolkit to Generate DDD Module Files
---------------------------------------

[](#️-toolkit-to-generate-ddd-module-files)

This package provides custom toolkit to help you generate files based on **Domain-Driven Design (DDD)** architecture.

### 📦 Installation

[](#-installation)

To install the package, run the following command in your Laravel project:

```
composer require hitech/ddd-modular-toolkit
```

---

### Publish Configuration

[](#publish-configuration)

```
# Publish all files
php artisan vendor:publish --provider="Hitech\DddModularToolkit\Providers\DddModularToolkitServiceProvider"

# Or publish separately
php artisan vendor:publish --tag=ddd-config
```

⚙️ Configuration Options
------------------------

[](#️-configuration-options)

The `ddd.php` configuration file allows you to customize various aspects of the DDD Modular Toolkit. Below is a summary of the available options:

OptionDescriptionDefault Value`blade.is_active`Enables or disables Blade templating for modules.`true``blade.path`Defines the custom path for Blade views within modules.`Blades``react.is_active`Enables or disables React templating for modules (coming soon).`true``react.path`Defines the custom path for React views within modules.`Views``middleware.auth`Applies authentication middleware to module routes.`false``middleware.api`Applies API middleware to module routes.`false`---

📁 Module Folder Structure (DDD Style)
-------------------------------------

[](#-module-folder-structure-ddd-style)

The `php artisan make:modulefiles {ModuleName}` command will generate a modular structure based on **Domain-Driven Design (DDD)** principles. Here's how the generated folder structure looks:

```
app/
└── Modules/
    └── {ModuleName}/
        ├── Application/
        │   ├── Data/               # Laravel Data classes for validation/transformation
        │   ├── DTO/                # Data Transfer Objects (immutable value objects)
        │   └── Services/           # Business logic layer
        ├── Domain/
        │   └── Contracts/          # Interfaces for repositories or domain services
        │   └── Entities/           # Domain entities (business objects)
        │   └── Constants/          # Domain constants
        │   └── Enums/              # Domain enums
        ├── Infrastructure/
        │   ├── Database/
        │   │   ├── Migrations/     # Module-specific database migrations
        │   │   ├── Models/         # Eloquent models
        │   │   └── Seeders/        # Seeders for initial data
        │   └── Repositories/       # Repository implementations
        └── Interface/
            ├── Controllers/        # HTTP controllers (extends base Laravel Controller)
            ├── Requests/           # Form Request classes with validation + toDTO()
            ├── Resources/          # API resource formatters
            └── Routes/             # Module-specific route definitions
            └── Views/              # Module-specific react files
            └── Blades/             # Module-specific blade files

```

> Each folder serves a clear role in enforcing separation of concerns, maintainability, and scalability across your Laravel application.

### 1. Generate Module Files

[](#1-generate-module-files)

```
php artisan make:module {name}:{submodule} [options]
```

**Description:** Generate DDD-style modular files in the `Modules/{name}` directory.

**Options:**

- `--A|--all` : Generate all components (default)
- `--D|--data` : Generate data-related files (should install [laravel-data](https://spatie.be/docs/laravel-data/v4/introduction))
- `--Y|--dto` : Generate DTO (Data Transfer Object)
- `--M|--migration` : Generate migration file
- `--O|--model` : Generate model
- `--R|--repository` : Generate repository
- `--S|--service` : Generate service
- `--C|--controller` : Generate controller
- `--Q|--request` : Generate request
- `--E|--resource` : Generate API resource
- `--T|--route` : Generate route file
- `--X|--seeder` : Generate database seeder

**Usage examples:**

```
# Generate all components for Product module
php artisan make:module Product --all

# Generate all components for Category submodule inside Product module
php artisan make:module Product:Category --all

# Generate only controller and service for Order module
php artisan make:module Order --controller --service

# Generate only controller and service for Cart submodule inside Order module
php artisan make:module Order:Cart --controller --service

# Generate repository and model for User module
php artisan make:module User -R -O

# Generate repository and model for Role submodule inside User module
php artisan make:module User:Role -R -O
```

---

### 2. Generate Modify Migration

[](#2-generate-modify-migration)

```
php artisan modify:migration {module} {table} [options]
```

**Description:** Create a new migration file for modifying an existing table within a specific module.

**Options:**

- `--add-column=` or `--ac=` : Add new column
- `--rename-column=` or `--rc=` : Rename existing column
- `--drop-column=` or `--dc=` : Drop column
- `--modify-column=` or `--mc=` : Modify existing column

**Usage examples:**

```
# Add 'status' column to 'contracts' table in Contract module
php artisan modify:migration Contract contracts --ac=status:string

# Rename 'name' column to 'full_name' in users table
php artisan modify:migration User users --rc=name:full_name

# Drop 'temp_field' column from products table
php artisan modify:migration Product products --dc=temp_field

# Combine operations: add 'notes' column and drop 'old_field' column
php artisan modify:migration Order orders --ac=notes:text --dc=old_field
```

---

📋 Requirements
--------------

[](#-requirements)

- PHP ^8.1
- Laravel ^12.19
- Illuminate Support ^12.19
- Illuminate Console ^12.19
- Illuminate Database ^12.19

🤝 Contributing
--------------

[](#-contributing)

Contributions are highly welcome! Please:

1. Fork this repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

📝 License
---------

[](#-license)

This project is licensed under the [MIT License](LICENSE).

👨‍💻 Author
----------

[](#‍-author)

**dhank77**

- Email:

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- Laravel Community
- All contributors who have helped

---

**Made with ❤️ for Laravel Community**

[⭐ Star this repo](https://github.com/hitech/ddd-modular) | [🐛 Report Bug](https://github.com/hitech/ddd-modular/issues) | [💡 Request Feature](https://github.com/hitech/ddd-modular/issues)

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance60

Regular maintenance activity

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% 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 ~13 days

Recently: every ~7 days

Total

14

Last Release

206d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5596d9388521953b63f36b1092e5b5ee61609c4a198a6271efbdd89ee97dbf6?d=identicon)[dhank77](/maintainers/dhank77)

---

Top Contributors

[![dhank77](https://avatars.githubusercontent.com/u/24799686?v=4)](https://github.com/dhank77 "dhank77 (17 commits)")[![zahidDmuhmamad](https://avatars.githubusercontent.com/u/170903238?v=4)](https://github.com/zahidDmuhmamad "zahidDmuhmamad (1 commits)")

---

Tags

ddd-architecturelaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hitech-ddd-modular-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/hitech-ddd-modular-toolkit/health.svg)](https://phpackages.com/packages/hitech-ddd-modular-toolkit)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

9782.1M161](/packages/laravel-ai)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k89.4M574](/packages/laravel-passport)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M119](/packages/laravel-mcp)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k21.1M148](/packages/laravel-jetstream)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k17.6M514](/packages/laravel-boost)

PHPackages © 2026

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