Using private packages
Sometimes, you need to use a private repository on GitHub or another location. I will cover here how to set this up in your composer.
Getting ready
We need a private repo, so if you have it and its composer.json
is set up properly, you will be set from there.
How to do it...
- First, go to GitHub and navigate to Settings│Personal access tokens:
- At the command line, type this:
>composer config –g github-oauth.github.com THE_TOKEN_FROM_ABOVE.
- Then, edit
composer.json
so that there are two new sections: - Then, let's tell the composer to install this:
>rm –rf composer.lock vendor >composer install
How it works...
Alright, let's talk about these steps. The first one is to make sure we are setting up our Homestead or Mac for easy access to the private repository. This is really key as well if you are doing 2FA on your GitHub account (which you should be doing). Step 2 wraps this up by adding it to your ~/.composer
configuration.
In the...