Foxws

DDD · Scaffolding · Artisan

Laravel DDD

Organize your Laravel app into Domain-Driven Design layers.

composer require foxws/laravel-ddd
Get startedSource
Latest release
0.0.9
Requires
PHP ^8.4
Laravel
13.x
Licence
MIT
Downloads
2.1K/mo

Introduction

Laravel DDD helps you organize a Laravel app using Domain-Driven Design (DDD) layers, instead of the framework's default app/ folder.

  • ddd:install sets up the layer folders and registers their namespaces in your composer.json.
  • ddd:make generates new classes straight into the right layer.

Installation

Install the package with Composer:

composer require foxws/laravel-ddd

You can publish the config file if you want to customize it:

php artisan vendor:publish --tag="ddd-config"

Let your AI agent do the hard parts. This package ships a Laravel Boost skill, laravel-ddd-development, that teaches your agent how to install, configure and use Laravel DDD. Install Boost and select the skill when prompted:

composer require laravel/boost --dev
php artisan boost:install

Already using Boost? Run php artisan boost:update --discover to pick up the skill. Then just ask, for example: "Set up Laravel DDD and create a CreateInvoice action in a Billing domain."

Usage

Install the DDD layer structure, then generate classes into it:

php artisan ddd:install
php artisan ddd:make CreateInvoice --type=action --domain=Billing

Learn more

Looking for Laravel Essentials' sensible defaults (Model::shouldBeStrict(), URL::forceHttps(), and more)? Those live in a separate package, foxws/laravel-essentials.