La Taverne du Dragon Ivre
Symfony for PHP developers
Comfortable with PHP and OOP? Learn Symfony by building, chapter after chapter, the website of the Drunken Dragon tavern.
74 exercises 12 chapters 17,820 XP About 47 h of practice
€79.00 €49.00 Incl. VAT, lifetime access
Founder price, 99 places left.
Buy the trackFirst chapter free with an account.
01
First steps at the tavern
Free
Symfony basics: routes, controllers, Twig templates, query parameters, a POST form, flash messages, services and dependency injection.
- Exercise 1: The tavern opens its doors Topics covered ControllerRouteTwig
- Exercise 2: The dish of the day Topics covered Route parameter404
- Exercise 3: Prices in gold pieces Topics covered Twig loopFiltersConditions
- Exercise 4: One sign for every page Topics covered Twig inheritanceincludepath()
- Exercise 5: How many adventurers? Topics covered Query string#[MapQueryParameter]Validation
- Exercise 6: The reservation Topics covered POSTRedirectFlash messages
- Exercise 7: The head cook Topics covered ServiceAutowiringDependency injection
- Final exercise: 🐉 Boss: trouble in the kitchen Topics covered DebuggingError pagesProfiler
-
Chapter course notes
02
The cellar and the pantry
🔒 Full track
Doctrine ORM: entities and mapping, repositories, QueryBuilder and DQL queries, ManyToOne and OneToMany relations, a console command to fill the database.
- Exercise 1: Bruna's ledger Topics covered EntityMappingDoctrine
- Exercise 2: The menu comes out of the database Topics covered RepositoryDependency injectionConsole command
- Exercise 3: A tailor-made query Topics covered QueryBuilderDQLParameters
- Exercise 4: Bruna invents a dish Topics covered persistSlugger
- Exercise 5: A place for every dish Topics covered ManyToOneOneToManyRelations
- Final exercise: 🐉 Boss: the flooded cellar Topics covered Debuggingschema:validate
-
Chapter course notes
03
The tavern's scrolls
🔒 Full track
Symfony forms: FormType and EntityType, validation constraints, UniqueEntity, CSRF protection, editing and deleting an entity.
- Exercise 1: A proper form Topics covered FormsFormTypeEntityTypeCSRF
- Exercise 2: Not just anything on the plate Topics covered ValidatorConstraintsUniqueEntity
- Exercise 3: Bruna fixes her menu Topics covered Edit formRoute {slug:plat}
- Exercise 4: The guestbook Topics covered FormsRelationsPOST-redirect-GET
- Exercise 5: Taking a dish off the menu Topics covered DeletionCSRFremove
- Final exercise: 🐉 Boss: the cursed scroll Topics covered DebuggingFormsCSRF
-
Chapter course notes
04
The keys to the tavern
🔒 Full track
Symfony security: firewall, form login, password hashing, roles and role hierarchy, access_control, IsGranted and voters.
- Exercise 1: Who goes there? Topics covered Firewallform_loginaccess_control
- Exercise 2: The staff register Topics covered UserInterfaceEntity providerHashing
- Exercise 3: To each their role Topics covered role_hierarchyIsGrantedis_granted()
- Exercise 4: To each their own dishes Topics covered VoterIsGranted with a subjectCurrentUser
- Exercise 5: Changing the lock Topics covered UserPasswordRepeatedTypeHashing
- Final exercise: 🐉 Boss: the stolen keys Topics covered Debuggingaccess_controlRole hierarchyVoter
-
Chapter course notes
05
Magic scrolls
🔒 Full track
A JSON API with Symfony: the Serializer and groups, DTOs with #[MapRequestPayload], 201, 400 and 422 responses, access token authentication.
- Exercise 1: The menu on a scroll Topics covered JSON API$this->json()Serializer#[Groups]
- Exercise 2: A dish on demand Topics covered #[Groups] on a method#[Context]format: 'json'Problem JSON
- Exercise 3: Booking by pigeon Topics covered POST JSONDTO#[MapRequestPayload]201 / 400 / 422
- Exercise 4: The guild's seal Topics covered access_tokenStateless firewallAccessTokenHandlerInterface401
- Exercise 5: Filtering the menu Topics covered #[MapQueryString]EnumQueryBuildervalidationFailedStatusCode
- Final exercise: 🐉 Boss: the lost pigeon Topics covered DebuggingFirewall#[Groups]Data leak
-
Chapter course notes
06
Never again!
🔒 Full track
Testing a Symfony application: functional tests with WebTestCase, PHPUnit unit tests, security and API tests, graded by mutants.
- Exercise 1: The first safety net Topics covered WebTestCasecreateClient()submitFormAssertions
- Exercise 2: Data to test with Topics covered Test databaseFixturesCrawler
- Exercise 3: The bill, please Topics covered Unit testTestCase#[DataProvider]expectException
- Exercise 4: Who is allowed? Topics covered loginUser()Security tests401 / 403Roles and voters
- Exercise 5: Testing the API Topics covered jsonRequest()API testsJSONAccess token
- Final exercise: 🐉 Boss: the lying tests Topics covered Reliable testsTest dataPrecise assertions
-
Chapter course notes
07
The messenger raven
🔒 Full track
Symfony Messenger: messages and handlers, async transports, retries and the failure transport, scheduled tasks with Scheduler, testing messages.
- Exercise 1: The first raven Topics covered MessengerMessage#[AsMessageHandler]MessageBusInterface
- Exercise 2: The raven flies in the background Topics covered TransportQueuemessenger:consumein-memory
- Exercise 3: The raven that gets lost Topics covered retry_strategyfailure_transportRetriesRedeliveryStamp
- Exercise 4: The evening raven Topics covered Scheduler#[AsSchedule]RecurringMessageScheduled task
- Exercise 5: Testing the ravens Topics covered Testing messagesIn-memory queueWorker
- Final exercise: 🐉 Boss: the broken aviary Topics covered DebuggingMessengerSchedulerFailure queue
-
Chapter course notes
08
Back to the cellar
🔒 Full track
Doctrine in production: schema and data migrations, ManyToMany relations, N+1 queries and joins, pagination with the Paginator.
- Exercise 1: The first migration Topics covered Migrationsdoctrine:migrations:diffdoctrine:migrations:migrateup() and down()
- Exercise 2: Keep the cellar full Topics covered Data migrationdoctrine:schema:validateDefault valuedown()
- Exercise 3: The pantry Topics covered ManyToManyOwning sideInverse side#[ORM\OrderBy]Join table
- Exercise 4: The Friday rush Topics covered N+1 queriesLazy loadingJoinaddSelectleftJoin
- Exercise 5: The big guestbook Topics covered PaginationPaginatorsetFirstResultsetMaxResults#[MapQueryParameter]
- Final exercise: 🐉 Boss: the collapsed storeroom Topics covered DebuggingMigrationsManyToManyN+1 queriesPagination
-
Chapter course notes
09
The tavern's inner workings
🔒 Full track
How Symfony works: kernel events and listeners, domain events, Doctrine listeners, service decoration, cache, environment variables.
- Exercise 1: Closed on Mondays Topics covered Kernel eventskernel.request#[AsEventListener]RequestEventClockInterface
- Exercise 2: The tavern bell Topics covered Domain eventEventDispatcherInterfacedispatchListener priority
- Exercise 3: The slug that writes itself Topics covered Doctrine listeners#[AsEntityListener]prePersistSluggerInterface
- Exercise 4: The wind oracle Topics covered Service decoration#[AsDecorator]#[AutowireDecorated]CacheCacheInterface
- Exercise 5: The tavern's settings Topics covered Environment variables#[Autowire(env:)]int: and csv: processors.env.env.test
- Final exercise: 🐉 Boss: the tavern turned upside down Topics covered DebuggingEventsDoctrine listenersService decorationCache
-
Chapter course notes
10
The life of a reservation
🔒 Full track
Sending emails with Symfony Mailer and Twig, then handling the life of a reservation with the Workflow component: transitions, guards, events.
- Exercise 1: The first scroll Topics covered MailerMailerInterfaceEmailMAILER_DSNassertEmailCount
- Exercise 2: A scroll with style Topics covered TemplatedEmailTwig email templateurl() and path()Sending service
- Exercise 3: The life of a reservation Topics covered WorkflowState machinePlaces and transitionsmarking_storeinitial_marking
- Exercise 4: Gorm's reservation book Topics covered Transitions from a controllerGuards#[AsGuardListener]TransitionBlockerworkflow_transitions()
- Exercise 5: Scrolls from the reservation book Topics covered Workflow events#[AsEnteredListener]entered and leaveMailer
- Final exercise: 🐉 Boss: the misplaced scrolls Topics covered DebuggingWorkflowGuardsWorkflow eventsMailer
-
Chapter course notes
11
The boss's orders
🔒 Full track
Symfony console commands: #[AsCommand], arguments and options, interactive questions, long tasks and progress bars, CommandTester.
- Exercise 1: The inventory Topics covered Console command#[AsCommand]SymfonyStyle#[Option]Exit codesCommandTester
- Exercise 2: Bruna's command Topics covered #[Argument]#[Option]Boolean optionsValidatorInterfaceCommand::INVALID
- Exercise 3: Gorm asks the questions Topics covered Interactive mode#[Ask]#[Interact]$io->choice()$io->confirm()--no-interaction
- Exercise 4: The big clean-up Topics covered Long-running taskprogressIterate()--dry-runBatch processingtoIterable()Verbosity
- Exercise 5: Testing the orders Topics covered CommandTester
- Final exercise: 🐉 Boss: orders misunderstood Topics covered DebuggingConsole commandExit codesNon-interactive modeBatch processing
-
Chapter course notes
12
The big night
🔒 Full track
The final project: an end-to-end feature with little guidance, bringing together entities, forms, security, a JSON API, emails, the console and tests.
- Exercise 1: The specifications Topics covered ModelingEntities and relationsValidationMigrations
- Exercise 2: The story night poster Topics covered Controller and templatesFormsSecurityN+1 queries
- Exercise 3: Sign-ups Topics covered FormsBusiness ruleFormErrorTemplatedEmail
- Exercise 4: The guilds join in Topics covered JSON API#[MapRequestPayload]HTTP status codesStateless firewall
- Exercise 5: The night before Topics covered Console commandMailerMigrationsIdempotency
- Final exercise: 🐉 Boss: the big night Topics covered Functional testsCommandTester
-
Chapter course notes
Learn Symfony by writing code
This track teaches Symfony 8 by writing code, not by watching videos. Every exercise runs in the browser, with nothing to install: a real Symfony project runs in the page, the preview updates as you type, and automated tests tell you when each objective is met.
The common thread is the website of the Drunken Dragon tavern. It starts as a page that shows the dish of the day and ends as a full application, with a database, user accounts, an API and background jobs.
What you will learn
- routes, controllers and Twig templates;
- Doctrine ORM: entities, relations, queries, migrations, and traps such as N+1 queries;
- forms and validation;
- security: login, roles, voters;
- a JSON API with the Serializer and token authentication;
- functional and unit tests with PHPUnit;
- Messenger, Scheduler, Mailer and Workflow;
- events, service decoration and console commands.
Each chapter ends with a boss, usually a debugging job: find out why the application is broken. Then comes a set of course notes to keep, as a web page and as a PDF.
Who it is for
Developers who already know PHP and object-oriented programming (classes, interfaces, namespaces) and want to move to Symfony. No prior Symfony knowledge is needed.
The first chapter is free with an account.