make:domain
v2.0The make:domain command generates a complete Domain Driven Design structure with a single command.
Usage
bash
php artisan make:domain UserTo overwrite existing files:
bash
php artisan make:domain User --forceThe 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.phpGeneration Flow
What is generated?
| Component | Purpose |
|---|---|
| Model | Eloquent model |
| Migration | Database schema |
| Controller | HTTP entry point |
| FormRequest | Validation |
| DTO | Data transport |
| Service | Business logic |
| Repository | Persistence |