Leanpub Header

Skip to main content

Symfony in action

Your path to the perfect app

Learn how to build modern, scalable PHP applications with Symfony 7. This hands-on guide takes you from the basics to advanced topics like testing, CI/CD, and code quality — with real-world examples and a touch of humor. Perfect for both beginners and experienced developers who want to master Symfony in practice.

Interested in this book? Show your support by saying what you'd like to pay for it!

$
PDF
About

About

About the Book

Discover a practical guide to Symfony 7.1, written by an experienced developer with years in the IT industry. This ebook is your roadmap from the very first steps in Symfony to building advanced, scalable applications.

? What’s inside?

  • A clear and practical introduction to Symfony – without unnecessary theory.
  • Step-by-step instructions for building modern applications.
  • Code examples written in a clean and easy-to-understand way.
  • Chapters on code quality, testing, CI/CD, and integration with popular tools.
  • Tips and tricks useful for both beginners and experienced developers.

? Who is this ebook for?

  • Beginners who want to start learning Symfony the right way.
  • PHP developers looking to level up their skills and build top-quality applications.
  • Anyone searching for a practical, well-written guide instead of dry documentation.

? Why this book?

This ebook is not just theory – it’s a hands-on approach to programming. Written with humor, practical insights, and real-world examples from everyday development work.

Start your Symfony journey today and build applications you’ll be proud of!

Contents

1. INTRODUCTION

1.1. WORD FROM THE AUTHOR

1.2. ABOUT THE AUTHOR

1.3. ABOUT THE EBOOK : PURPOSE AND STRUCTURE

2. UNDERSTANDING OF SYMFONY

2.1. ARCHITECTURE OF THE SYMFONY FRAMEWORK

2.2. SYMFONY KEY COMPONENTS

2.3. SYMFONY VS. OTHER PHP FRAMEWORKS

3. WORK ENVIRONMENT

3.1. SYMFONY INSTALLATION AND CONFIGURATION

3.1.1. SYSTEM REQUIREMENTS

3.1.2. XAMPP LOCAL SERVER

3.1.3. COMPOSER AND SYMFONY CLI INSTALLATION

3.2. INTRODUCTION TO GIT AND GITLAB BASICS OF VERSIONING

3.2.1. CREATING A GITLAB REPOSITORY

3.2.2. PRINCIPLES OF TEAMWORK WITH GIT

4. BUILDING THE APPLICATION STEP BY STEP

4.1. APPLICATION DESIGN : FROM CONCEPT TO ARCHITECTURE

4.1.1. CREATION OF FUNCTIONAL REQUIREMENTS

4.1.2. DATA MODELS AND DATABASE STRUCTURE

4.2. SYMFONY CONFIGURATION : ROUTING, CONTROLLERS AND TEMPLATES

4.2.1. ROUTING IN SYMFONY

4.2.2. CREATION OF THE FIRST CONTROLLER

4.2.3. TWIG TEMPLATE SYSTEM

4.3. DATABASE WORK

4.3.1. ORM DOCTRINE: MODEL DEFINITIONS AND ENTITY MANAGEMENT

4.3.2. CREATING DATABASE MIGRATIONS

4.3.3. EXECUTING QUERIES WITH QUERYBUILDER

4.3.4. USING ENTITIES IN PRACTICE

4.4. FORM HANDLING AND DATA VALIDATION

4.4.1. CREATING FORMS IN SYMFONY

4.4.2. VALIDATION OF USER DATA

4.5. USER AUTHORIZATION AND AUTHENTICATION

4.5.1. CREATION OF LOGIN AND REGISTRATION SYSTEM

4.5.2. APPLICATOION SECURITY

5. ADVANCED SYMFONY FEATURES

5.1 BUILDING A REST API IN SYMFONY

5.1.1. CREATING API ENDPOINTS

5.1.2. TESTING API WITH POSTMAN

5.2. SYMFONY POWER TOOLS: THE SUPERPOWERS YOU DIDIN'T KNOW YOU NEEDED

5.2.1. WORKING WITH SUBDOMAINS

5.2.2 MESSENGER - QUEUES

5.2.3 EVENT DISPATCHER

5.2.4 CREATING CUSTOM LOGS IN SYMFONY

5.2.5 .ENV VARIABLES IN THE CODE

5.2.6 ADVANCED ROUTING TRICKS IN SYMFONY

5.2.7 ENTITIES – NOT JUST DATABASE TABLES ANYMORE

5.3 INTERNATIONALIZATION AND LOCALIZATION

5.3.1 TRANSLATIONS IN SYMFONY

5.3.2 SUPPORT FOR MULTIPLE LANGUAGES IN THE APPLICATION

5.3.3 CURIOUS CASES

6. CODE QUALITY ANALYSIS

6.1 LINT

6.2 PHP CODESNIFFER

6.3 PHPMD

6.4 PHPSTAN

6.5 RECTOR

6.6 CS-FIXER

6.7 EASY CODING STANDARD

6.8 LOCAL PHP SECURITY CHECKER

7. TESTING AND DEBUGGING

7.1 DEBUGGING IN SYMFONY DEBUG TOOLBAR

7.2 UNIT TESTS

7.3 TESTING OF CONTROLLERS AND SERVICES

7.4 DATABASE INTEGRATION TESTS

7.5 DATAPROVIDER IN TESTING

8. INTEGRATION WITH GITLAB AND CI/CD

8.1 WHAT IS CI/CD? WHY IS IT WORTH USING?

8.2 GITLAB CI CONFIGURATION FOR SYMFONY

8.3 CI/CD IN PRACTICE – CREATING .gitlab-ci.yml

9. APPLICATION DEPLOYMENT

9.1 CHOICE OF PRODUCTION ENVIRONMENT

9.2 PRODUCTION SERVER CONFIGURATION

9.3 RUNNING APPLICATIONS ON THE SERVER

9.4 APPLICATION MONITORING AND PERFORMANCE

10. FURTHER DEVELOPMENT OF THE APPLICATION

10.1 MAINTAINING AND EVOLVING YOUR APP OVER TIME

10.2 SYMFONY UPDATES

10.3 REFACTORING – A DEVELOPER'S BEST FRIEND

11. AT THE END

11.1 FAQ: COMMON SYMFONY PITFALLS AND HOW TO FIX THEM

11.2 FURTHER LEARNING – RESOURCES WORTH EXPLORING

11.3 PRACTICAL TIPS FOR THE ROAD AHEAD

Share this book

Categories

Author

About the Author

Paweł Liwocha

My name is Paweł Liwocha, and I’ve been passionate about programming and database design for over a decade. I started coding in 2006 and have been working professionally in IT since 2011. Along the way, I’ve built custom systems, created my own PHP framework, and now I focus on Symfony, developing modern and scalable applications.

I love sharing knowledge and helping other developers grow their skills. This ebook is my way of showing that Symfony can be practical, approachable, and… actually fun to learn.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub