My website is running smoothly with Laravel in a sub-domain, but now I have added a new dependency https://github.com/PHPOffice/PHPExcel to my local project using composer require phpoffice/phpspreadsheet
.
The code is already working fine in my local environment, but now I need to push my new changes to the website.
Pushing the controllers, routes, views, etc it’s easy, but how do I push the dependency?
- I have full access to the cPanel
- I can create SSH keys
- The project is running in a sub-domain
- I’m using Visual Studio Code
- I have generated a private and public key for SSH
- I have initially deployed my Laravel project to the server using FTP Filezilla
For what I have read so far, I should be using SSH with PuTTY, but if I could use an extension in Visual Studio Code, would be great.
2
Answers
Well I can create SSH keys but don't have access to login with them. With that said I follow the tutorial here https://laraveldaily.com/laravel-and-shared-hosting-working-with-ftp-and-phpmyadmin/ that teaches how to use FTP to upload/update the application.
Composer stores all the imported libraries in the
/vendor
folder. When you push your local copy of the website up, it will push up the vendor folder and you’ll be set.If you’re working on a remote server and you need to still download the dependencies, run
That will download the dependencies for the project. You’ll need to run it from the command line (ssh) and be in the website directory.
Some companies don’t allow ssh access to the server. In that case, you can run
php composer.phar update
on your local machine, assuming you have a php runtime install (WAMP, XXAMP, ect). Then when you push or copy your code to your server, the libraries will be included.