Symfony framework comes with a built-in console tool that we can trigger by simply executing the following command within our project root directory:
php bin/console
By doing so, an extensive list of available commands is shown on screen, sectioned into the following groups:
assets
cache
config
debug
doctrine
generate
lint
orm
router
security
server
swiftmailer
translation
These empower us with various functionalities. Our special interest moving forward is going to be around doctrine
and generate
commands. The doctrine
command, more specifically doctrine:generate:crud
, generates a CRUD based on an existing Doctrine entity. Furthermore, the doctrine:generate:entity
command generates a new Doctrine entity inside an existing bundle. These can be extremely handy for cases where we want a quick and easy entity creation, alongside the entire CRUD around it. Similarly, generate:doctrine:entity
and generate:doctrine:crud
do the same thing.
Before we go ahead and...