yunkeweb/laravel-ddd

Laravel DDD modular monolith scaffolding and architecture helpers.

Maintainers

Package info

github.com/yunkeweb/laravel-ddd

pkg:composer/yunkeweb/laravel-ddd

Fund package maintenance!

yunkeweb

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-05-29 11:14 UTC

This package is auto-updated.

Last update: 2026-05-29 11:20:12 UTC


README

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