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 trick –
Centra make
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"
–
Horatia current
which now at this time is 4 :) –
Marston 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.0
–
Horatia You must define the "dev" env in the command line :
php bin/console --env dev
php bin/console make:entity Product --env dev
The 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=test
–
Thais I think you are in prod environment. Check if your the value of APP_ENV inside .env file is not equals to prod.
In case you generate a .env.local file, you have to delete it in your dev environment.
You 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
If you have installed symfony / maker-bundle for the dev mode you will only be able to use it for this mode. If you are in prod mode then go to dev mode and try again
Try composer require symfony/maker-bundle --dev
it work for me.
To fix the problem you just create new project with (full properties), here is command for create a project:
symfony new --full project-name
after you create project like the command above, you now can able to use (make).
© 2022 - 2024 — McMap. All rights reserved.
php bin/console
– Anstusmake:entity
is for ORM, not ODM. FWIW we still provide the "old" generator with ODM – Litmancomposer require doctrine maker
(as per the documentation) I get the following error[UnexpectedValueException] Could not parse version constraint maker: Invalid version string "maker"
– Horatiacomposer require maker
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.0
– Horatia