The most useful php composer commandsMostafa KamalBlockedUnblockFollowFollowingMar 5#composer #php #code4mk #0devcoComposer is dependency manager for php package.
PHP developers are known about packagist and composer.
Most used php composer commands that will be helpful for you.
# requirerequire is the most used commandcomposer require vendor-name/package-name// global purpose | local machinecomposer require global vendor-name/package-name~ specific versioncomposer require "vendor-name/package-name:vX.
X"composer require "vendor-name/package-name:2.
0"# showshow command return all package name from your projectcomposer show# outdatedyou can see all outdated package, which package hasn’t the latest versioncomposer outdated# updateupdate command updates all outdated commandscomposer update~ update specific packagecomposer update vendor-name/package-name…~ update global packagecomposer global update vendor-name/package-name# examplecomposer global update laravel/installer# removeremove command remove php package from your projectcomposer remove vendor-name/package-name# installinstall command first create a composer.
lock if not exists composer.
composer lock file contains composer.
json all package with version.
then install those packages.
composer install# initinit command create your package.
json schema with some arguments.
composer init# dump-autoloadautoload is the most important command.
This command adds class, alias, provider etc inside vendorcomposer dump-autoloadhttps://getcomposer.
md#code4mk #0devco.. More details