0

I wonder if is possibile to "move" the vendor folder to another location. I mean, I've a structure like this

  • /
  • Laravel Project 1
  • Laravel Project 2
  • Laravel Project 3
  • [... others ...]
  • CDN (For vendor if I can)

Well as you know every project comes with the vendor/ folder. I want to move that folder inside the CDN and "merge" all the requirements for every project in another composer outside the projects folder (inside CDN i guess).

Why this?

Simply because I've notice that vendors folder are nearly the same for every project so if I can combine all the "differences" in one single big vendor folder I can manage all the dependencies in one single location, pretty cool

Is that possible?

TY for any help :) Have a nice day.

0

1 Answer 1

1

In Laravel you can change the folder your applications load the framework and dependencies from bootstrap/autoload.php.

There's a require __DIR__.'/../vendor/autoload.php'; line in it and you can change it to whatever you need. Thus you can change it to some outside folder, common to all projects.

Sign up to request clarification or add additional context in comments.

5 Comments

Yup I see, and how about the composer part? How can I run a composer inside the CDN? just adding a single composer.json with all the require?
Yes, why not? Laravel does not depend on composer, it depends on the packages it maintains.
Ok, I'm doing it right now. If it's ok you'll take the point :)
There's a problem, My custom library inside "project1/app/lib/Project1" is hidden, IDK why. If I test another project, like project2, where there isn't any custom library it works like a charm
How are you including that library? I'm guessing a composer psr autoloader. You'll have to include it some other way or set up composer just for those (in each project you need to autoload libs) and include it's bootstrap.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.