Composer 2 cheatsheet
Composer 2: Autoloading and production
7 common Composer 2 tasks.
Regenerate the autoloader
Rebuild the autoload files after adding classes or changing the autoload section.
composer dump-autoload
Optimize the autoloader
Generate a class map for faster autoloading in production.
composer dump-autoload --optimize
Install for production
Install without development packages and with an optimized autoloader.
composer install --no-dev --optimize-autoloader
Allow a plugin
Composer 2.2 and later ask you to allow plugins explicitly. Allow one by name.
composer config allow-plugins.vendor/plugin true
Install a tool globally
Install a package into your global Composer folder, for command-line tools.
composer global require laravel/installer