In this article, we learn how we can create packages and distribute them for reuse using composer. We just need to put the code on a public git repository and register it with packagist to make it discoverable – that’s all we need to create a composer package.
Complete tutorial blog post -
https://bootsity.com/php/create-a-composer-package-and-list-on-packagist