Skip to content

The Patterns and Principles course is complete

November 9, 2026

Building Maintainable PHP Applications: Patterns and Principles is complete. All 11 chapters and 45 lessons are published, and the course is free. It's the second of six courses in the series. The first five chapters went live on 5 October, and the other six are now live too.

What the course is about

Foundations covered how to think about code that has to keep changing. Patterns and Principles is about what to do with that thinking in the codebase you already have. Each lesson is a tool, pattern or habit you can add to an existing Laravel, Symfony or plain PHP project. None of them needs a rewrite or a new architecture first.

The first chapter sets the rule for the rest of the course: pick up a pattern when it solves a specific problem in front of you, and leave it in the box otherwise. Most lessons are code-heavy, with examples in Laravel, Symfony or plain PHP.

What's inside

ChapterLessonsWhat it covers
Tools, Not Rules1How to treat the patterns in this course as tools for a specific problem
Small Objects, Big Impact2 to 6Primitive obsession, DTOs, value objects, named constructors and immutable objects
Principles of Good Object Design7 to 12Tell, Don't Ask, the Law of Demeter, composition vs inheritance, rich domain models, SOLID and guard clauses
Wiring Things Together13 to 17Dependency injection vs the service locator, factories, repositories, Active Record vs Data Mapper, and the catch-all Service class
Behavior and Variation18 to 23Decorator, Strategy, Specification, Null Object, domain events, and why Singleton is usually the wrong tool
Commands and Queries24 to 27Command-query separation, commands and command handlers, queries and query handlers, and CQRS
Commands, Queries and Events on a Bus28 to 30A command bus, a query bus that caches answers, and an event bus that hands one event to many listeners
Persistence, Flow and State31 to 34Unit of Work and Identity Map, the Pipeline pattern, the State pattern and the Builder pattern
Failure and Validation35 to 38Exceptions as design, domain vs framework exceptions, the Result pattern, and where input and domain validation belong
Testing as a Discipline39 to 44The testing pyramid, test doubles, TDD, BDD, mutation testing and refactoring without changing behavior
Putting It Together45A capstone that refactors a legacy reservation feature and keeps only the patterns that earn their place

The course is marked intermediate. It's written for developers who already build PHP applications and want to improve the one they work in today.

What's new since the first five chapters

The last two newsletters said the first five chapters were live, 23 lessons in all. Chapters 6 to 11 add the other 22 lessons. They cover commands, queries and the buses that route them, Unit of Work, Pipeline, State and Builder, exceptions and result objects, testing, and the capstone.

Start the course

What comes next

Architectures is the third course in the series, and it goes live on 16 November. It steps back from single patterns to the shape of the whole application. It walks through Hexagonal Architecture, Clean Architecture and Vertical Slices, what each one tries to solve, and where each one hurts. It ends with a capstone that restructures Hearth, the hotel booking app the course builds on, around ports, slices and modules.

Free content keeps coming

Insights and quick tips stay free to read, and new free courses, learning paths, code reviews, insights, quick tips and projects keep being released alongside the paid catalogue.

Follow along

New content is announced on X, Bluesky, LinkedIn, Facebook, Instagram, as well as the newsletter as it publishes.