Convert Symfony Auth Scaffolding Login to use Form Builder

If you follow various tutorials (like this one) to set up some basic user authentication steps like a login form, logout route, user registration form… you’ll use commands like php bin/console make:registration and php bin/console make:registration which will generate login and registration forms for you. When I did this in Symfony 6, I ended up with a registration form created with Symfony’s Form Builder method and a login form created with a typical html form in the twig templates. Later when adding the symfonycasts/reset-password-bundle flow to add a ‘forgot my password’ step, this created another form using Form Builder. Eventually I ended up with all of my auth steps using Form Builder except the login form. Inconsistency- yuck!

I’m using Symfony 6.2 as of this writing.

Here’s how to switch the login form so it works like the rest.

Continue reading “Convert Symfony Auth Scaffolding Login to use Form Builder”

Disable Doctrine Migrations Check in Symfony

I wanted to set up my own Symfony Skeleton project and get all my favourite packages and configuration set up. One need I have is to have Doctrine and Doctrine Migrations packages installed but I don’t want them to be used (yet). The problem is that I was finding a lot of errors in my logs like this:

app.ERROR: error while trying to collect executed migrations {...} (File: /vendor/doctrine/doctrine-migrations-bundle/Collector/MigrationsCollector.php | Line: 41)

doctrine.INFO: Connecting with parameters array{...} (File: /vendor/doctrine/dbal/src/Logging/Driver.php | Line: 31)
Continue reading “Disable Doctrine Migrations Check in Symfony”

Keeping Symfony Projects Up To Date

Keeping any project which uses a framework or a collection of 3rd party libraries up to date is an exercise in continuous upgrades. In my situation, I have dozens of projects on a variety of internal and 3rd party frameworks, so keeping everything updated – from the PHP version to the framework and library versions – is an important and time consuming process. Here are some strategies and techniques.

Continue reading “Keeping Symfony Projects Up To Date”