I am working with symfony4 and I want to create and use my own bundle.
I have created my own bundle following the tutorial: https://symfonycasts.com/screencast/symfony-bundle
I am encoutering a problem at the Chapter 09: Proper Bundle composer.json File.
I have followed all steps of this chapter. I've tried to launch the command composer require bon-coin-bundle:*@dev
as indicated, but here are my errors:
- "bon-coin-bundle" is not a valid alias. Did you mean this:
"symfony/monolog-bundle", supported aliases: "monolog-bundle"
Thus I tried to launch other commands without better results: composer require ../bon-coin-bundle:*
, composer require ../bon-coin-bundle:*@dev
...
I've edited the composer.json like this:
{
"name": "bon-coin-bundle",
"description": "Bon Coin",
"type": "symfony-bundle",
"license": "MIT",
"authors": [
{
"name": "matodo",
"email": "matodo@xxx.com"
}
],
"require": {
"php": "^7.1.3"
},
"autoload": {
"psr-4": {
"bonCoinBundle\\": "bonCoinBundle"
}
}
}
(I am not really sure of what I've done for the autoload part, but I don't think that the problem comes frome there)
My folders are ranked like this: a bonCoinBundle folder contains DependencyInjections, Resources and services for my bundle. The folder bonCoinBundle is not in my current projet symfony.
bonCoinBundle
|- DependencyInjection
Resources
...
symfonyProject
|- src
...