PHPackages                             imran-ahmed-optilius/laravel-ddd-maker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. imran-ahmed-optilius/laravel-ddd-maker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

imran-ahmed-optilius/laravel-ddd-maker
======================================

Artisan command to scaffold Clean Architecture + DDD feature files for Laravel (Action, Request, UseCase, Service, Repository, Output DTO, Response).

v1.1.2(1mo ago)07MITPHPPHP ^8.1CI failing

Since Apr 12Pushed 1mo agoCompare

[ Source](https://github.com/imran-ahmed-optilius/laravel-ddd-maker)[ Packagist](https://packagist.org/packages/imran-ahmed-optilius/laravel-ddd-maker)[ Docs](https://github.com/imran-ahmed-optilius/laravel-ddd-maker)[ RSS](/packages/imran-ahmed-optilius-laravel-ddd-maker/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

Laravel DDD Maker
=================

[](#laravel-ddd-maker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d8c18764c029af5f68debe120c67f950d7e94c448659e6fc0608288bae65cc91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d72616e2d61686d65642d6f7074696c6975732f6c61726176656c2d6464642d6d616b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imran-ahmed-optilius/laravel-ddd-maker)[![Total Downloads](https://camo.githubusercontent.com/fa2a7f1068e5d67ad04850afe2db521f567c8cb452e56e7597c0c903d45ae892/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d72616e2d61686d65642d6f7074696c6975732f6c61726176656c2d6464642d6d616b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imran-ahmed-optilius/laravel-ddd-maker)[![CI](https://github.com/imran-ahmed-optilius/laravel-ddd-maker/actions/workflows/ci.yml/badge.svg)](https://github.com/imran-ahmed-optilius/laravel-ddd-maker/actions)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

A single Artisan command that scaffolds a **complete Clean Architecture + DDD feature** in seconds — Request, Action, UseCase, Service, Repository, Output DTO, and Response — all with proper namespaces, interfaces, and PSR-12 compliant code.

---

Requirements
------------

[](#requirements)

DependencyVersionPHP^8.1Laravel^10.0, ^11.0, or ^12.0---

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

[](#installation)

```
composer require imran-ahmed-optilius/laravel-ddd-maker --dev
```

Laravel's auto-discovery will register the service provider automatically.

---

Usage
-----

[](#usage)

### Interactive wizard

[](#interactive-wizard)

```
php artisan make:ddd
```

The command walks you through everything step by step:

```
╔═══════════════════════════════════════════════════╗
║  Laravel DDD Maker  by imran-ahmed-optilius       ║
║  Clean Architecture + Domain-Driven Design        ║
╚═══════════════════════════════════════════════════╝

  Enter the file prefix (e.g. ForHomePageTeacherGet):
  > ForHomePageTeacherGet

  ── Complexity & Naming Questions ─────────────────────────────

  Will this feature require Value Objects (VO) for IDs, status, or types? (yes/no) [no]:
  > no

  Will the Repository require a dedicated Input DTO for its arguments? (yes/no) [no]:
  > no

  Will the Service require a dedicated Input DTO for its arguments? (yes/no) [no]:
  > no

  Will the Response have a different or multiple names? (yes/no) [no]:
  > no

  Will the Output (DTO) have a different or multiple names? (yes/no) [no]:
  > no

  Will the Repository have a different or multiple names? (yes/no) [no]:
  > no

  Is there a need for a domain Entity class? (yes/no) [no]:
  > no

  Should an Eloquent Model be generated? (yes/no) [no]:
  > no

  Will this feature need a Request (Form Request) class? (yes/no) [yes]:
  > yes
  Request class name [default: ForHomePageTeacherGetRequest]:
  >

  Enter the feature folder name (e.g. HomePage or MembershipStatus/History):
  > HomePage

  ── Files to be generated ─────────────────────────────────────

    Request:
      • app/Http/Requests/Api/V1/HomePage/ForHomePageTeacherGetRequest.php
    Action:
      • app/Http/Controllers/Api/V1/HomePage/ForHomePageTeacherGetAction.php
    Use Case:
      • app/UseCases/HomePage/IForHomePageTeacherGetUseCase.php
      • app/UseCases/HomePage/ForHomePageTeacherGetUseCase.php
    Domain Service:
      • app/Domain/HomePage/Services/IForHomePageTeacherGetService.php
      • app/Infra/HomePage/Services/ForHomePageTeacherGetService.php
    Repository:
      • app/Domain/HomePage/Repositories/IForHomePageTeacherGetRepository.php
      • app/Infra/HomePage/Repositories/ForHomePageTeacherGetRepository.php
    Output DTO:
      • app/Domain/HomePage/Services/Output/ForHomePageTeacherGetOutput.php
    Response:
      • app/Http/Responses/Api/V1/HomePage/IForHomePageTeacherGetResponse.php
      • app/Http/Responses/Api/V1/HomePage/ForHomePageTeacherGetResponse.php

  Generate all files now? (yes/no) [yes]:
  > yes

  ── Generating ────────────────────────────────────────────────
  ✔ CREATED  app/Http/Requests/Api/V1/HomePage/ForHomePageTeacherGetRequest.php
  ✔ CREATED  app/Http/Controllers/Api/V1/HomePage/ForHomePageTeacherGetAction.php
  ...

  ── Add to AppServiceProvider::register() ─────────────────────
  ...

  ── Add to routes/api.php ─────────────────────────────────────
  Route::get('/for-home-page-teacher-get', \App\Http\Controllers\Api\V1\HomePage\ForHomePageTeacherGetAction::class);

  Done! All files generated successfully.

```

### With inline options

[](#with-inline-options)

```
php artisan make:ddd --prefix=ForHomePageTeacherGet --folder=HomePage
```

### Multiple repositories, outputs, or responses

[](#multiple-repositories-outputs-or-responses)

When the wizard asks *"use a custom or multiple names?"*, answer `yes` and enter each name one by one. Leave the input blank to finish.

---

Generated File Structure
------------------------

[](#generated-file-structure)

```
app/
├── Http/
│   ├── Requests/Api/V1/{Folder}/
│   │   └── {Prefix}Request.php               ← FormRequest (Optional)
│   ├── Controllers/Api/V1/{Folder}/
│   │   └── {Prefix}Action.php                ← Invokable controller
│   └── Responses/Api/V1/{Folder}/
│       ├── I{Response}.php                   ← Response interface
│       └── {Response}.php                    ← Response implementation
├── Models/
│   ├── {Model}.php                           ← Eloquent Model (Optional)
│   └── Entities/
│       └── {Entity}.php                      ← Domain Entity (Optional)
├── UseCases/{Folder}/
│   ├── I{Prefix}UseCase.php                  ← UseCase interface
│   └── {Prefix}UseCase.php                   ← UseCase implementation
├── Domain/{Folder}/
│   ├── Vo/
│   │   └── {Vo}.php                          ← Value Object (Optional)
│   ├── Services/
│   │   ├── I{Prefix}Service.php              ← Domain Service interface
│   │   ├── Input/
│   │   │   └── {Prefix}ServInput.php         ← Service Input DTO (Optional)
│   │   └── Output/
│   │       └── {Output}.php                  ← Output DTO
│   └── Repositories/
│       ├── I{Repo}.php                       ← Repository interface
│       └── Input/
│           └── {Repo}Input.php               ← Repository Input DTO (Optional)
└── Infra/{Folder}/
    ├── Services/
    │   └── {Prefix}Service.php               ← Service implementation
    └── Repositories/
        └── {Repo}.php                        ← Eloquent repository

```

---

After Generation
----------------

[](#after-generation)

### 1. Register bindings in `AppServiceProvider`

[](#1-register-bindings-in-appserviceprovider)

The command prints the exact snippet. Add it to the `register()` method:

```
use App\UseCases\HomePage\IForHomePageTeacherGetUseCase;
use App\UseCases\HomePage\ForHomePageTeacherGetUseCase;
// ... other imports

public function register(): void
{
    // Use Cases
    $this->app->bind(IForHomePageTeacherGetUseCase::class, ForHomePageTeacherGetUseCase::class);

    // Domain Services
    $this->app->bind(IForHomePageTeacherGetService::class, ForHomePageTeacherGetService::class);

    // Repositories
    $this->app->bind(IForHomePageTeacherGetRepository::class, ForHomePageTeacherGetRepository::class);

    // Responses
    $this->app->bind(IForHomePageTeacherGetResponse::class, ForHomePageTeacherGetResponse::class);
}
```

### 2. Register the route in `routes/api.php`

[](#2-register-the-route-in-routesapiphp)

The command prints this too:

```
Route::get('/for-home-page-teacher-get', \App\Http\Controllers\Api\V1\HomePage\ForHomePageTeacherGetAction::class);
```

### 3. Fill in the `TODO` placeholders

[](#3-fill-in-the-todo-placeholders)

Each generated file has clearly marked `TODO` comments:

- `rules()` in the Request class — add your validation rules
- Constructor properties + getters in the Output DTO
- `toArrayResponse()` mapping in the Response class
- Eloquent queries in the Repository implementation
- Field mapping in the Service implementation

---

Customising Stubs
-----------------

[](#customising-stubs)

All stubs live in `vendor/imran-ahmed-optilius/laravel-ddd-maker/src/Stubs/*.stub`.

If you want to permanently customise them for your project, copy the `src/Stubs` folder into your project and update `StubRenderer::$stubPath` to point to your copy, or publish them once support for `php artisan vendor:publish` is added in a future version.

---

Running Tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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 ~1 days

Total

4

Last Release

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17267ccc791f2e9d288de59c6a1e7eb0e1f569f51456fb15ad0b859fe78e769d?d=identicon)[imran-ahmed-optilius](/maintainers/imran-ahmed-optilius)

---

Top Contributors

[![imran-ahmed-optilius](https://avatars.githubusercontent.com/u/188434785?v=4)](https://github.com/imran-ahmed-optilius "imran-ahmed-optilius (6 commits)")

---

Tags

laravelgeneratorscaffoldartisanboilerplatedddclean architecture

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/imran-ahmed-optilius-laravel-ddd-maker/health.svg)

```
[![Health](https://phpackages.com/badges/imran-ahmed-optilius-laravel-ddd-maker/health.svg)](https://phpackages.com/packages/imran-ahmed-optilius-laravel-ddd-maker)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4721.5k](/packages/erag-laravel-lang-sync-inertia)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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