sevenTopo's avatar

Laravel and Vendor

Hi developper i was wondering if it's possible to move the vendor folder outside of the project and make it global for all the projects just like :

   htdocs:
               ->vendor 
              ->laravel_project 1
              ->larvel->project 2 ....etc.

if it's possible how can i force the composer to not install the vendor cause we allready have a vendor for all the projects .

0 likes
7 replies
Sinnbeck's avatar

Untested but I suppose you can move the vendor folder and composer.json to another directory and edit this line in index.php and artisan

require __DIR__.'/../vendor/autoload.php';
1 like
Sinnbeck's avatar

@sergiu17 Wont that clash if there are multiple composer.json files with different content? Or can composer manage this somehow?

1 like
MA's avatar

Isn't this a bad idea? What if two or more Laravel projects needs a different version of a package? Can you update them independently?

2 likes
sevenTopo's avatar

yes it looks bad ...and installing vendor all the time for every project is bad too

Sinnbeck's avatar

Are all projects exactly the same with exactly the same packages?

jove's avatar

I would say installing the vendor packages for every package is the opposite of bad. like @sinnbeck asks, if there are different needs for packages you will find yourself some nice collision when project one requires monkeystuff 1.0 but project two requires monkeystuff 2.0

Please or to participate in this conversation.