Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Shirshak's avatar

Composer local package inside local package

Suppose I want to have packages like this:

College/ (yahoo/college)
-composer.json
-src
----ClassA/ (yahoo/classa)
----ClassB/ (yahoo/classb)
----ClassC/ (yahoo/classc)

College is package which is made of packages like class A, class B, class C. So college package is just used for loading service providers of class A, class B and class C and other thing that happens in Laravel.

In main package I added repository to college and required yahoo/ college. And inside college's composer.json I added repository for class A ,class B and class C but the thing is from main folder when i do composer update it says classA, classB and classC are not found.

Here is composer.json of college package (just to show how classa is added at college composer.json file)

{
  "name": "yahoo/college",
  "type": "library",
  "authors": [
    {
      "name": "Shirshak",
      "email": "[email protected]"
    }
  ],
  "repositories":[
    {
      "type":"path",
      "url":"src/classa",
      "options":{
        "symlink":true
      }
    }
  ],
  "require":{
    "yahoo/classa": "@dev"
  },
0 likes
0 replies

Please or to participate in this conversation.