A Practical Introduction to Laravel × DDD × Clean Architecture
About this guide
A 20-chapter guide for developers experienced with SPA development (Vue/React) to learn domain-driven design (DDD) and clean architecture with Laravel, step by step. Starting from the basics of Laravel, you build up DDD theory, clean architecture implementation, operational quality, and a comprehensive hands-on practice in a continuous flow.
What makes this guide different
- Incremental: learn in the order Laravel basics → DDD theory → architecture implementation → operational techniques → comprehensive practice
- No Laravel experience needed: Chapter 2 covers the basics of Laravel API development before moving on to DDD
- A consistent example: follow how each concept lands in implementation using the order system of an e-commerce site
- Modern PHP assumed: targets PHP 8.2+ (readonly / enum / constructor promotion) and Laravel 11+
Structure of the guide
Learning path
The guide is organized into five parts, so you can learn step by step from the basics of Laravel to DDD in practice.
| Part | Theme | Chapters | Overview |
|---|---|---|---|
| Introduction | Laravel basics | 1-2 | Getting started / Basics of Laravel API development |
| DDD theory | Tactical design | 3-9 | Why DDD / Basic concepts / Value objects / Entities / Aggregates / Domain services / Domain events |
| Clean architecture and Laravel | Implementing the layers | 10-14 | Architecture overview / Use case layer / Presentation layer / Repository pattern / Table design |
| Practical techniques | Operational quality | 15-18 | Transaction management / Error handling / Testing strategy / Authentication and authorization |
| Comprehensive practice | Wrap-up | 19-20 | Implementing the order system / Conclusion and next steps |
Who this guide is for
- Frontend engineers with SPA development experience (Vue/React) who want to learn backend API development
- Developers without Laravel experience, as long as you know basic PHP syntax
- Anyone feeling the pain of "Fat Controller" and "Fat Model"
- Anyone unsure of where to put business logic
- Anyone who wants to write more maintainable code
Prerequisites
| Level | Knowledge |
|---|---|
| Required | Basic PHP syntax (classes, interfaces) |
| Required | Database basics (tables, relations) |
| Required | Basic API concepts (HTTP methods, JSON) |
| Recommended | Basic object-oriented concepts (encapsulation, inheritance, polymorphism) |
| Not required | Laravel experience (this guide covers it from the basics) |
Recommended ways to read
- Beginners: read top to bottom, running each chapter's code as you go
- Experienced with Laravel: skim Chapter 2 and start in earnest from Chapter 3, "Why DDD"
- Using it as a reference: open the relevant chapter directly from the table above
Now, let's begin with Getting started.