Looking to hire Laravel developers? Try LaraJobs

laravel-ddd maintained by yunkeweb

Description
Laravel DDD modular monolith scaffolding and architecture helpers.
Author
Last update
2026/05/29 13:14 (dev-main)
License
Downloads
0

Comments
comments powered by Disqus

Laravel DDD

Laravel modular monolith DDD scaffolding, architecture helpers, and Laravel Boost resources.

Installation

composer require yunkeweb/laravel-ddd --dev
php artisan ddd:install

The install command publishes config/ddd.php, publishes customizable stubs to stubs/vendor/laravel-ddd, and adds the default PSR-4 mapping:

"Src\\": "src/"

Optional install flags:

php artisan ddd:install --no-stubs
php artisan ddd:install --no-autoload
php artisan ddd:install --force

--dto=spatie generates DTOs that extend Spatie\LaravelData\Data. Install spatie/laravel-data before using that option:

composer require spatie/laravel-data

Commands

php artisan ddd:module Identity
php artisan ddd:action Identity LoginWithPassword
php artisan ddd:action Identity LoginWithPassword --dto=spatie
php artisan ddd:repository Identity User
php artisan ddd:repository Identity User --no-bind
php artisan ddd:controller Identity LoginController
php artisan ddd:architecture-test

Laravel Boost

This package ships Boost guidelines and the laravel-ddd-architecture skill from resources/boost.

php artisan boost:install --discover
php artisan boost:update --discover

Architecture

  • Domain stays pure PHP.
  • Application coordinates use cases.
  • Infrastructure adapts Laravel, packages, persistence, and external services.
  • Presentation handles HTTP, console, requests, and resources.
  • Interface bindings belong in each module's Infrastructure provider.
  • Mature Laravel packages can be integrated when they fit; package-specific code stays outside Domain.

Testing

composer test