Download the PHP package shahmy/laravel-ddd-toolkit without Composer
On this page you can find all versions of the php package shahmy/laravel-ddd-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shahmy/laravel-ddd-toolkit
More information about shahmy/laravel-ddd-toolkit
Files in shahmy/laravel-ddd-toolkit
Package laravel-ddd-toolkit
Short Description Laravel Domain-Driven Design toolkit — Artisan commands for enterprise DDD architecture generation
License MIT
Informations about the package laravel-ddd-toolkit
laravel-ddd-toolkit
Artisan commands for enterprise Laravel Domain-Driven Design — scaffold complete bounded contexts in seconds.
Overview
laravel-ddd-toolkit is a Composer package that brings a full suite of ddd:* Artisan commands to any Laravel application. It generates the complete DDD layer structure — Application, Domain, Infrastructure, Presentation, and Tests — along with typed PHP 8.3+ class stubs for every common DDD building block.
Works standalone from the command line. Pairs seamlessly with the Laravel DDD Architect VSCode extension.
Requirements
- PHP 8.1+
- Laravel 10, 11, 12, or 13
Installation
The service provider is auto-discovered. Publish the config file:
This creates config/ddd.php in your project.
Configuration
config/ddd.php:
Commands
Project initialization
Creates the src/ directory, scaffolds the Shared bounded context, and registers Src\\ in composer.json.
Domain scaffolding
Generates the full bounded context under src/Merchant/ with all layers and subfolders. Every empty directory receives a .gitkeep. A README.md and module.json are created at the domain root.
Class generators
All class generators follow the same pattern:
| Command | Output location | Generated class |
|---|---|---|
ddd:entity |
Domain/Entities/ |
Eloquent-backed domain entity |
ddd:repository |
Domain/Repositories/ + Infrastructure/Persistence/Repositories/ |
Interface + Eloquent implementation |
ddd:service |
Domain/Services/ |
Domain service |
ddd:dto |
Application/DTOs/ |
readonly class with fromArray, fromRequest, toArray |
ddd:action |
Application/Actions/ |
Single-responsibility action |
ddd:usecase |
Application/UseCases/ |
Clean Architecture use case |
ddd:event |
Domain/Events/ |
Immutable domain event |
ddd:value-object |
Domain/ValueObjects/ |
readonly value object with invariant validation |
ddd:enum |
Domain/Enums/ |
Backed PHP 8.1+ enum |
ddd:policy |
Domain/ |
Laravel policy |
ddd:resource |
Presentation/API/Resources/ |
API resource |
ddd:request |
Presentation/API/Requests/ |
Form request |
ddd:test |
Tests/Feature/ or Tests/Unit/ |
Pest or PHPUnit test |
Examples:
Generated Domain Structure
Customising Stubs
Publish the built-in stubs to your project:
Stubs are copied to stubs/ddd/ in your project root. Edit them freely. The toolkit will use your versions automatically — published stubs always take precedence over the package defaults.
Stub placeholders use {{ PLACEHOLDER }} syntax (case-insensitive):
| Placeholder | Value |
|---|---|
{{ NAMESPACE }} |
Full PSR-4 namespace for the class |
{{ CLASS }} |
Class name |
{{ DOMAIN }} |
Domain name |
Package Architecture
Atomic operations — all file and directory creation runs inside a transaction. Any failure triggers a full rollback, leaving no partial structures on disk.
Testing
Code style is enforced by Laravel Pint:
VSCode Integration
This package works as a standalone CLI toolkit. If you use VSCode, the Laravel DDD Architect extension detects this package and delegates all generation commands to it — giving you the same results from the Command Palette or sidebar without typing Artisan commands manually.
Contributing
- Fork the repository and branch from
main. - Use Conventional Commits for commit messages.
- Ensure
./vendor/bin/pestpasses and./vendor/bin/pint --testreports no violations. - Add a
CHANGELOG.mdentry under[Unreleased]. - Open a pull request.
Changelog
See CHANGELOG.md for release history.
License
MIT © shahmy
All versions of laravel-ddd-toolkit with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/filesystem Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0|^13.0