Answer the question
In order to leave comments, you need to log in
Is it necessary to write the Composer package namespace ("autoload") by hand in the composer.json of the main application?
I decided to make a module for Laravel in the form of a Composer package.
I install from a local repository (folder). Everything is installed, but for some reason it then starts looking for a class, don’t understand where at all:
Moreover, if I write it in the main composer.json of the application (at the root of Laravel)
"autoload": {
"psr-4": {
"MeVendor\\Hello\\": "packages/mevendor/hello/src/"
}
},
{
"name": "mevendor/hello",
"description": "Hello package!",
"type": "project",
"license": "MIT",
"authors": [
{
"name": "mevendor",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"MeVendor\\Hello\\": "src/"
}
},
"require": {}
}
Answer the question
In order to leave comments, you need to log in
In general, the fact was that I launched Composer in the Host system, and I run Laravel in Docker Compose :-)
After installing the package through Composer, which is in the container, everything showed up by itself and began to work fine ))
I, with your permission I will not delete this topic - I will leave it as a monument to my own stupidity)))) What if someone else steps on this rake :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question