how to add public github repository in my laravel project using composer
To add a public GitHub repository to your project using Composer, you can follow these steps:
composer.json
file in your Laravel project.repositories
section of composer
file. If repository includes a composer.json
file, you can directly require the package using its name and version. Otherwise, you can specify the repository URL directly.Here's an example of how to add a public GitHub repository in your composer.json
:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/username/repository-name" } ], "require": { "username/repository-name": "dev-master" } }
Replace "username" with the GitHub username of the repository owner and "repository-name" with the name of the repository.
composer.json
file, run the following Composer command in your terminal to install the package:composer install
This will fetch and install the package from the public GitHub repository into your Laravel project.
Please ensure that you have the necessary permissions to access the public GitHub repository and that the repository is publicly accessible.
getcomposer.org
opensource.com
oshara.ca