I have existing Laravel project. And I want to add some functionality in it. I found a project on Github with same features. How can I easily integrate this project in my existing project without affecting it?
1 Answer
If the project you found on GitHub is a PHP library, check to see if it is available as a Composer package by searching on Packagist. If it is, just follow the Composer installation instructions to add it as a dependency.
If the project you want to use is not available on Packagist, you can download it directly from GitHub and add it as a vendor. See this post for manually adding external libraries into Laravel and using Composer to autoload the class.
Another option is to include the external project as a Git Submodule. According the Git docs the benefit of this is:
A submodule allows you to keep another Git repository in a subdirectory of your repository. The other repository has its own history, which does not interfere with the history of the current repository. This can be used to have external dependencies such as third party libraries for example.