To address your first issue regarding the auth.json file for multiple licenses, you can simply add multiple entries under the http-basic key. Each entry should correspond to a different Spatie package repository if they are indeed separate. However, if both licenses are for packages from the same repository, you would typically use the same credentials for both. Here's how you can structure your auth.json:
{
"http-basic": {
"satis.spatie.be": {
"username": "<YOUR-SPATIE.BE-ACCOUNT-EMAIL-ADDRESS-HERE>",
"password": "<YOUR-COMMON-LICENSE-KEY-HERE>"
}
}
}
If you have different repositories for each package, you would add them like so:
{
"http-basic": {
"media-library.satis.spatie.be": {
"username": "<YOUR-SPATIE.BE-ACCOUNT-EMAIL-ADDRESS-HERE>",
"password": "<YOUR-MEDIA-LIBRARY-LICENSE-KEY-HERE>"
},
"comments.satis.spatie.be": {
"username": "<YOUR-SPATIE.BE-ACCOUNT-EMAIL-ADDRESS-HERE>",
"password": "<YOUR-COMMENTS-LICENSE-KEY-HERE>"
}
}
}
For the second issue, installing a package from a ZIP file can be done by modifying your composer.json to include the path to the ZIP file using the repositories key and then requiring the package as usual. Here's how you can do it:
- Add the local repository to your
composer.json:
{
"repositories": [
{
"type": "artifact",
"url": "path/to/directory/with/zips/"
}
]
}
-
Place your ZIP file(s) in the directory specified above.
-
Require the package using Composer:
composer require spatie/media-library
composer require spatie/comments
Composer will look for the packages in the directories specified. If it finds the ZIP files there, it will use them instead of downloading from Packagist.
Remember to replace spatie/media-library and spatie/comments with the actual package names and versions you are trying to install, if they are different.
Please note that using ZIP files for package installation is less common and might not provide the same ease of updates as using Composer with a repository. It's also important to ensure that the ZIP files contain the correct directory structure expected by Composer.