What files are need to upload after composer required <package>? - laravel

So my hosting company not support composer. and reuploading all Laravel framework php files are too much take time just for one composer package. what are files need to be uploaded to hosting after composer required?
all i know is "package" folder in vendor folder, composer.json, and "config" file in config folder. is there any other files and folder?

You must upload vendor/composer and vendor/autoload.php too..
I hope this works

The file that you forget: Facades, ServiceProvider

the easiest way is reupload all vendor directory. or track all vendor directory using git, so you can archive the different after update composer and upload it

Related

Calling class from vendor

EDIT Autoload
require __DIR__ . '/../../../vendor/autoload.php';
I am calling it this way:
$generatorSVG = new \Picqer\Barcode\BarcodeGeneratorSVG();
The error:
Message: Class 'Picqer\Barcode\BarcodeGeneratorSVG' not found
The class exist. I am not installing it via composer but copying it in the vendor folder, because I dont have composer and the server and dont have permissions to install it.
Using PHPStorm and by ctrl+click on the class leads me to it. I am wrong with the proper calling it in CI ?
Manually copying files in the vendor directory is not enough, because Composer generates a bunch of lookup files (vendor/composer/autoload_*.php) to be able to figure out where the files are located that you want to load via Composer's autoloader.
Either, you should composer require the package you want to install or require all your source files manually in your bootstrap.php or index.php.
If this is a custom package you built, be aware that Composer can also pull it directly from a Git instance, local directory, or zip file. There's no need to create a public package on Packagist or self-host it with Satis. Check the Composer docs on how to configure repositories to find out more.

Is npm install affecting Laravel project?

I am working on the Laravel project, and intend to use Vue.js as its client-side scripting. When I searched the internet, I found that I had to use the npm install command. My question is if I run the order, will it affect the project I'm working on?
For example, in the directory structure or variable section?
It will change only package.json and /node_modules folder (it will download vue.js last version package into this folder) in your root directory. But it won't affect your existing codebase until you don't use them via importing or accessing it. It is like installing a package with composer, but not using it. The downloaded package will stay in /vendor folder and package name in composer.json, composer.lock

Installing Composer and Packagers - first time

I have never used Composer, but I want to use PHPSpreadsheet package, and it is recommended that Composer is used.
I am on a MAC using XAMPP and Netbeans.
I have installed Composer, and I have run the following command to get and install the PHPSpreadsheet package.
php ../../Composer/composer.phar require phpoffice/phpspreadsheet
I am running this in my project folder, (hence the ../../ to where Composer.phar is located.
This downloads the files into a vendor folder in my project folder.
What should I do then? Do I need to keep it in the Vendor folder, or can I move into a folder of my choice?
Netbeans has Composer options in the menus, but as far as I can see, this is for creating dependencies rather than installing packages.
I know I am totally missing the point of Composer somewhere, but have spent hours just trying to get this work.
Many thanks
You should really start with the docs -> https://getcomposer.org/doc/01-basic-usage.md
You have to keep the vendor directory - this is where all dependencies are kept. If you require more packages - then they will be installed in that directory.
After requring the package you have to load it so the PHP will know all the classes. Composer comes with great autolader. It is located by default in vendor/autoload.php. So what you have to do now is to require this file in your project. After that all classes from composer packages will be loaded automaticaly each time you use them in the code :)
I hope this will help you with this great tool. Cheers.

Remove composer from PHP project?

Is there a way to build project, created with composer, remove all «trash» files and save all dependencies?
Or i can use it as is - upload all directories to server and that's all?

Why is vendor package not pushing to github even when "/vendor" is not listed in .gitignore file?

When I add files to my local repository, some vendor packages are excluded even though they are not listed in the .gitignore file. Since they are not pushed to the remote repository, other developers are not able to pull the vendor packages.
The Vendors files are not to upload on github.The composer.json file of your laravel project have all the information to install all of your vendors.So try to update your composer.
To update composer use cmd or terminal command:
composer update
composer install
Be sure that the composer.json file is not ignore by .gitignore file.
Fixing the root .gitignore is not enough.
I had the same problem and found out that there are multiple .gitignore in subfolders.

Resources