Symfony 5 – In Controller, execute migration

  controller, doctrine, migration, php, symfony

I’m looking for a way to execut the command which make migration into a controller.
I already took a look at doc but it doesn’t really give a response to my question.

What i want : Be able to execute php bin/console doctrine:migrations:generate in a controller.
Moreover, there no security problem by doing this ?

Have a nice day !

Source: Symfony Questions