Reputation: 2444
I'm trying to create a package to publish in packagist, for this I am using the package level composer.json to install the dependencies.
my package level composer.json is as follow
{
"name": "my-company/my-package",
"description": "Package Desciption",
"authors": [
{
"name": "xxxxx",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"require": {
"propaganistas/laravel-phone": "^4.1"
}
}
I declare this on my main root autoload in composer.json as follow:
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/",
"MyCompany\\MyPackage\\": "packages/my-company/my-package/"
}
},
when I run the composer install in the root composer.json
the child composer.json is not triggered.
Upvotes: 0
Views: 154
Reputation: 2444
finally, I solve this by adding repository block and define the path in the root composer.json and also adding the newly create package name into the require-dev
"repositories": [
{
"type": "path",
"url": "packages/my-company/my-package"
}
],
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~7.0",
"mockery/mockery": "~1.0",
"my-company/my-package": "1.0.*"
},
Upvotes: 1