When I want to make a pull request for a Laravel package on GitHub I do it at the moment in the following way:
I find this a bit cumbersome - is that actually the correct way of doing it?
For example if I want create a PR for the voyager package I would have to do the following commands for step 1. & 2.
>laravel new create-pr
>cd create-pr
>composer require tcg/voyager
>php artisan voyager:install
then remove the folder tcg/voyager
and clone the fork as new folder tcg/voyager
.
If I skip composer require tcg/voyager
and directly clone the fork into tcg/voyager
I cant install the package because of
First, fork the official repository tcg/voyager
into your personal repository iwasherefirst2/voyager
. Then
1) Create a new Laravel Project
2) Add repository iwasherefirst2/voyager
to composer.json:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/iwasherefirst2/voyager.git"
}
],
3) Now install tcg/voyager
with --pref-source
this will automatically install
iwasherefirst2/voyager
into vendor/tcg/voyager
and setup the git connection.
composer require tcg/voyager --prefer-source
Now you may change files inside vendor/tcg/voyager
and push them (they will be pushed to your local repository `iwasherefirst2/voyager).
Remarks
1) If you would like to have the package folder in the root of your application package/voyager
, you may create a symlink like this:
ln -s vendor/tcg/voyager package
2) To see modified files in vendor you may call composer status -v
$ composer status -v
You have changes in the following dependencies:
/path/to/app/vendor/symfony/yaml/Symfony/Component/Yaml:
M Dumper.php
3) If you run composer update
you will get a warning if it overwrites any of your files
$ composer update
Loading composer repositories with package information
Updating dependencies
- Updating symfony/symfony v2.2.0 (v2.2.0- => v2.2.0)
The package has modified files:
M Dumper.php
Discard changes [y,n,v,s,?]?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With