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”

Custom Error Pages in Symfony Framework

As I make my way through some tutorials on SymfonyCasts and begin a re-write of my SyntaxSeed website from CodeIgniter to Symfony… I occasionally encounter something that took a bit more struggle than a simple web search. This is one of those tasks.

Symfony gives you some generic built in error pages, for example when you get a 404 missing resource error or a 500 error. When working in your dev environment you don’t see these, you instead get the nice Whoops error pages with extra details. Customizing the error pages requires a few steps.

Continue reading “Custom Error Pages in Symfony Framework”

Decision Time: PHP Framework Dilemma

My freelance business has grown, and reached a critical decision point for my future development. I’ve been puzzling over this for a while – why not puzzle it out in public!?

I need to pick a PHP framework. Or maybe not pick one. But my dilemma is kind of unusual. I’d love the opinions of other experienced PHP devs! But hear me out, my situation is a bit unique.

Continue reading “Decision Time: PHP Framework Dilemma”