Search code examples
phplaravelcomposer-phppackagist

How do I use a Laravel package created by me in production?


I'm writing an app using Laravel 4.2. This time, I needed some extra functionality and I decided to create a package. I used the workbench functionality as described in Laravel's docs.

Currently (and locally), the package is very small but it suits my app very well. I don't think this should be published to the community because it is still very green. I'll put a few hours into it when I finish with my app but I can't right now.

Now, I know the workbench/ directory is not to be pushed to production. Then, how do I use my package on production?

So far, I heard I have to push the package to GitHub (which I already did), and then publish it on Packagist. But I feel that publishing the script as is won't be helpful to others and might as well harm those in search of this functionality (like me a few days ago) on this so under developed package.

Is there a way to add my package to my app's composer.json and have it installed without publishing it to the community while it's under development?


Solution

  • What you are looking for is "private repository". Inside your composer.json file you can define an object repositories where you can define other locations to search for this repository

    Detailed explanation can be found on Autoload bitbucket repository. The same principal is true for github.