Private Git repos as Composer dependencies
You would be forgiven for thinking that you must release a package on Packagist if you want to be able to use it as a Composer package with your other projects. This is definitely not the case, and for those little packages that you would prefer to keep completely private, you should definitely use this trick.
You can share your Composer package privately among your own projects by simply having it accessible on a version control system (VCS), such as Git. The most popular publicly accessible implementation of Git is undoubtedly GitHub, though there are many other choices, including hosting your own private repositories on your own server.
In the projects where you want to use this shared library, you must add a little extra JSON config to instruct Composer that it needs to go and query this specific repository.
The best place to learn about this technique is on the official docs page:
Repositories - Composer