It seems that my package composer.json is not being read.
And yes, I did composer dump-autoload many times, but no success..
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys, I created a package but it just works I if add the packaged src directory to the root package.json file.. Why doesn't it just work with my package composer.json file like all other packages?
I added it into my package composer.json file:
"autoload": {
"psr-4": {
"Fmcdigital\\MyPackage\\": "src/"
}
},
But to make it work, I also need to put on root composer.json.
Thanks.
composer install fmcdigital/emailsignature in your application or wherever.You than don't need to add the autoloading within your Laravel application, Composer will do that for as long as autoloading.php is required (Laravel does this by default).
But be aware anybody will have access to your repository and can download or install it with Composer as long as it is public.
Please or to participate in this conversation.