Symfony course

A practical course that goes from installing the framework to three capstone projects. Every lesson is a manual: the code, the explanation of what it does, and the next step that follows from it. The course is written and published part by part: the cards below open the parts, and the tree lists the lessons that are ready to read.

The framework and Twig come first, because a Symfony project is a skeleton before it is a program. Doctrine follows, with entities, migrations, repositories and relations, then forms and validation, services, JSON controllers and the Serializer. Security, console commands, events, Messenger, mail and the cache come next, then the session, CSRF, translations, Dotenv and the profiler, the tests, data and integrations, and production. The last part builds a blog and a JSON API, one lesson at a time.

Start with What is Symfony and where it runs. For a short description of the framework read Symfony basics; other PHP topics are on the PHP page.

Symfony course: Getting started What Symfony is, the CLI and a new project, route attributes, controllers, and Twig in its basic and advanced forms. Open Symfony course: Doctrine and the database The ORM bundle, entities and their columns, migrations, repositories, and OneToMany and ManyToOne relations. Open Symfony course: Forms, services and JSON Form types and Assert validation, services with autowiring, controllers that return JSON, and the Serializer. Open Symfony course: Security Firewalls and access control, the User entity and password hashers, the login form, and the voters that decide access. Open Symfony course: Console and background work Console commands, events and subscribers, Messenger messages and handlers, the Mailer, and cache pools. Open Symfony course: State and settings The session and flash messages, CSRF tokens, the Translator, Dotenv and env placeholders, and the profiler. Open Symfony course: Testing A functional test with WebTestCase and PHPUnit, then fixtures that load and reset test data. Open Symfony course: Data and integrations Pagination, uploads, API Platform, DQL, transactions, advanced migrations and security, and the HTTP client. Open Symfony course: Production The Scheduler, webhooks, Asset Mapper, the deploy checklist with a warm cache, and performance. Open Symfony course: Capstones and next steps A capstone blog, a capstone JSON API, and the modern Symfony tour. Open

All articles