Use PHP Enums as Doctrine type in Symfony

credit: sensiolabs tweet

PHP 8.1 adds support for Enumerations. An Enumeration, is an enumerated type that has a fixed number of possible values. (see more details)

✍🏻 In this article, I’ll show you how to use an Enum as a doctrine WITHOUT adding configuration.

First, what is a doctrine type?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Smaine Milianni

Smaine Milianni

Fullstack Developer- certified Symfony 4,5 and certified AWS Solution Architect - Freelancer - Remote Worker