Jingyu He
Jingyu He

Reputation: 41

How to use Laravel and GitHub for multiple programmers?

I have a question about laravel and GitHub. Why does laravel automatically ignore vendor directory.

It just makes it so hard if I want to use work on the project with two computers, and after another computer download the GitHub version of laravel project (which is missing some files), the server does not work.

The command line is telling me the following:

Warning: require(C:\app\XAMPP\htdocs\xxxx\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\app\XAMPP\htdocs\xxxx\bootstrap\autoload.php on line 17

Fatal error: require(): Failed opening required 'C:\app\XAMPP\htdocs\xxxx\bootstrap/../vendor/autoload.php' (include_path='.;C:\app\XAMPP\php\PEAR') in C:\app\XAMPP\htdocs\xxxx\bootstrap\autoload.php on line 17

How can I fix it?

Upvotes: 4

Views: 1197

Answers (1)

edcs
edcs

Reputation: 3879

Under most circumstances, the vendor directory shouldn't be kept in source control. This has nothing to with Laravel; it's the way you generally work with Composer.

The way to ensure that everyone in your group (and your production servers) are running the same dependencies is to keep composer.lock and composer.json in source control, that way members of your team can check out the repo and run composer install NOT composer update.

Then, when you're ready to update a package, you can run composer update and commit the changes to composer.lock and composer.json.

Upvotes: 4

Related Questions