Following the documentation found here I enter php bin/console make:entity Product in Terminal and get the following error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "make" namespace.
Following the documentation found here I enter php bin/console make:entity Product in Terminal and get the following error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "make" namespace.
prod environment?The website-skeleton puts the Maker Bundle in the require-dev section of your composer.json by default:
"require-dev": {
...
"symfony/maker-bundle": "^1.0",
...
}
If you've set APP_ENV=prod in your .env file and ran bin/console it would ignore all dev requirements and thus wouldn't enable the Maker Bundle.
Simply enabling the dev environment again (APP_ENV=dev) would do the trick then.
local switched it back to dev and it did the trickmake is a command of doctrine component. Just add doctrine maker.
composer require doctrine maker
https://symfony.com/doc/current/doctrine.html#installing-doctrine
composer require doctrine maker gives me the following error: [UnexpectedValueException] Could not parse version constraint maker: Invalid version string "maker"You need Symfony 3.4 or higher. For Symfony 3.4 you will need to add it to the registerBundles function in config/AppKernerl():
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
// [...]
$bundles[] = new \Symfony\Bundle\MakerBundle\MakerBundle();
}
Bear in mind that the environment where it is installed is 'dev'.
try
composer remove maker
composer require maker --dev
and then
php bin/console make:entity Product
https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
composer require maker --dev I get the following error: [InvalidArgumentException] Could not find package maker. Did you mean one of these? yab/formmaker yab/crudmaker greabock/maker ctf0/simple-menu symfony/maker-bundle So I ran composer require symfony/maker-bundle and received this: [InvalidArgumentException] Could not find package symfony/maker-bundle at any version matching your PH P version 5.5.36.0The problem just happend to me. I was in test environment. You have to be in dev environment.
Check APP_ENV value in .env file. It must be the following :
APP_ENV=dev
APP_ENV=testYou can use composer for installer maker bundle, you have install a light version of symfony.
composer require symfony/maker-bundle
but if you have this problem surely need composer doctrine and security
composer require doctrine/orm
with
require doctrine/doctrine-bundle
And
composer require symfony/security-bundle
composer require doctrine/doctrine-migrations-bundle
Now you have this with php bin/console !
make make:auth Creates a Guard authenticator of different flavors
make:command Creates a new console command class
make:controller Creates a new controller class
make:crud Creates CRUD for Doctrine entity class
make:docker:database Adds a database container to your docker-compose.yaml filemake:entity Creates or updates a Doctrine entity class, and optionally an API Platform resource
make:fixtures Creates a new class to load Doctrine fixtures
make:form Creates a new form class
make:message Creates a new message and handler
make:messenger-middleware Creates a new messenger middleware
make:migration Creates a new migration based on database changes
make:registration-form Creates a new registration form system
make:reset-password Create controller, entity, and repositories for use with symfonycasts/reset-password-bundle
make:serializer:encoder Creates a new serializer encoder classmake:serializer:normalizer Creates a new serializer normalizer class
make:stimulus-controller Creates a new Stimulus controller
make:subscriber Creates a new event subscriber class
make:test [make:unit-test|make:functional-test] Creates a new test class
make:twig-extension Creates a new Twig extension class
make:user Creates a new security user class
make:validator Creates a new validator and constraint class
make:voter Creates a new security voter class
php bin/consolemake:entityis for ORM, not ODM. FWIW we still provide the "old" generator with ODMcomposer require doctrine maker(as per the documentation) I get the following error[UnexpectedValueException] Could not parse version constraint maker: Invalid version string "maker"