The process is quite simple.
For Syncing newly added packages from local machine to the server, follow below steps.
- Add the package to the vendor folder
- Upload \vendor\composer folder
For just adding the newly added package from local machine to the server, follow below steps
- Add the package to the vendor folder
- Add a reference in \vendor\composer\autoload_namespaces.php
- Add a reference in \vendor\composer\autoload_psr4.php
- Also look for any other references in all files of \vendor\composer folder. There are 8-10 files in \vendor\composer folder.
Should work automatically now when the vendor\autoloader.php is called.