Skip to content

make:domain

v2.0

The make:domain command generates a complete Domain Driven Design structure with a single command.

Usage

bash
php artisan make:domain User

To overwrite existing files:

bash
php artisan make:domain User --force

The command uses Laravel's native generators whenever possible, preserving framework conventions.

Generated Structure

text
app/
├── Domain/
│   └── User/
│       ├── DTO/
│       │   └── UserDTO.php
│       ├── Repositories/
│       │   └── UserRepository.php
│       └── Service/
│           └── UserService.php
├── Http/
│   ├── Controllers/
│   │   └── UserController.php
│   └── Requests/
│       └── UserRequest.php
└── Models/
    └── User.php

Generation Flow

CommandModelMigrationDomainHTTP

What is generated?

ComponentPurpose
ModelEloquent model
MigrationDatabase schema
ControllerHTTP entry point
FormRequestValidation
DTOData transport
ServiceBusiness logic
RepositoryPersistence

Released under the MIT License.