So I have a Laravel installation in which I have modified several Laravel core files in the vendor folder (mainly mail related).
I want everyone who clones the repo to have the same changes obviously. What is the correct way of handling this?
Fork Laravel repo: https://help.github.com/articles/fork-a-repo/
Make a new branch in forked repo, branch name must be prefixed with dev-
, e.g. dev-bugfix
Make changes in forked repo, commit them, push them to dev-bugfix
branch.
Include forked repo in your composer.json
:
{
"repositories": [{
"type": "package",
"package": {
"version": "dev-bugfix",
"name": "laravel/framework",
"source": {
"url": "https://github.com/<your_github_username>/framework.git",
"type": "git",
"reference": "dev-bugfix"
}
}
}],
"require": {
"laravel/framework": "dev-bugfix"
}
}
After this you can pull your custom changes anytime, without having to commit it to your specific project.
Read more about forking and loading packages here: https://getcomposer.org/doc/05-repositories.md#vcs
PS. it's a bad practice to modify vendor package files, try not to do that in future.