Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel: Deploy and vendor folder

I've just finished a simple work done in Laravel 4 and I'm ready to Deploy on my server.

I found that the vendor folder has a size of 100MB and I wonder if it is necessary to upload all its subfolders. I suppose that I don't use the most of those libraries, is there a good practise to follow to deploy a Laravel project?

like image 635
MatterGoal Avatar asked Jul 03 '13 11:07

MatterGoal


2 Answers

I haven't deployed an L4 app myself to this point, but will run into issues as I don't have git/composer access on my host server as well. Unless something clever comes along, FTP/SSH is my only avenue for getting my files on the server.

The /vendors folder is absolutely required in order for your application to function. Think of vendors as the /core folder in other frameworks. All of the heavy lifting in Laravel is managed through the packages contained inside of /vendors, and so without that folder your app will just crash.

like image 55
Tim F Avatar answered Oct 08 '22 20:10

Tim F


You better use

composer create-project laravel/laravel --prefer-dist <project directory>

To create your project. Your vendor dir space usage will start at 10MB, only. (I just did it it here and that's what downloaded for me).

And looks like you also can:

composer update --no-dev --prefer-dist

To reduce your current project space usage.

But... vendor directory and all its first level subdirectories are mandatory (as long as you are using all the packages you have installed), but there are some subdirectories inside them you may easily ignore when deploying, such as:

*/examples/*
*/docs/*
*/docs2/* (Doctrine)
*/tests/*
*/test/*
*/Tests/* (Carbon)
*/swiftmailer/swiftmailer/notes/*
like image 32
Antonio Carlos Ribeiro Avatar answered Oct 08 '22 21:10

Antonio Carlos Ribeiro