Skip to content

A clean, production-ready Laravel starter kit built around Domain-Driven Design. Includes a structured domain layer, application layer, infrastructure boundaries, and PSR-4 autoloading out of the box. Start new Laravel projects with a scalable, maintainable architecture from day one.

License

Notifications You must be signed in to change notification settings

ldaidone/laravel-ddd-starter

Repository files navigation

📦 Laravel DDD Starter

A clean, opinionated Laravel project template that comes preconfigured for Domain-Driven Design. This starter includes a ready-made DDD folder structure, PSR-4 autoloading, and the full laravel-ddd-commands package — so you can scaffold domains, entities, use cases, value objects, repositories, and more from day one.

License Packagist Downloads

"Buy Me A Coffee"


🚀 Quick Start

Create a new Laravel DDD-ready project:

composer create-project ldidone/laravel-ddd-starter app-name

You’ll get a fresh Laravel install with:

  • Pre-built DDD folder structure under app/
  • Autoload namespaces for Domains & Infrastructure
  • The latest version of ldaidone/laravel-ddd-commands
  • Optional post-install instructions in your terminal

📂 Folder Structure

This starter ships with an opinionated domain layout already in place:

app/
├── Domains/
│   └── Billing/
│       ├── Entities/
│       ├── ValueObjects/
│       ├── DataTransferObjects/
│       ├── UseCases/
│       ├── Actions/
│       ├── Repositories/
│       └── Events/
└── Infrastructure/
    ├── Persistence/
    ├── Http/
    ├── Services/
    └── Support/

You can add more top-level domains freely.


🔧 Included Package: laravel-ddd-commands

This template includes:

"require": {
    "ldaidone/laravel-ddd-commands": "^0.1.1"
}

Which gives you fully integrated generators such as:

php artisan ddd:create-domain Billing
php artisan ddd:create-entity Billing/User
php artisan ddd:create-use-case Billing/RegisterUser
php artisan ddd:create-repository Billing/UserRepository
php artisan list ddd

See full documentation here:

➡️ Laravel-DDD-Commands


🧱 Philosophy

This starter intentionally:

  • Removes dynamic configuration for core DDD directories Ensuring predictable project structure and long-term architectural stability.
  • Enforces explicit domain boundaries Each domain is isolated inside app/Domains/*.
  • Treats Infrastructure as a first-class layer Living under app/Infrastructure.
  • Follows Laravel’s conventions wherever possible But strengthens them with DDD clarity.

🧪 Testing

If you extend this template or contribute:

composer test

Support

If this saves you time or helps your project, consider starring ⭐ and consider buying me a coffee! ☕️ — it keeps the ideas flowing!


🤝 Contributing

Pull requests are welcome. Please open an issue first if you're planning large changes.


📄 License

Released under the Apache 2.0 License.

See the LICENSE file for more details.


About

A clean, production-ready Laravel starter kit built around Domain-Driven Design. Includes a structured domain layer, application layer, infrastructure boundaries, and PSR-4 autoloading out of the box. Start new Laravel projects with a scalable, maintainable architecture from day one.

Resources

License

Stars

Watchers

Forks

Packages

No packages published