The require
command adds new packages to the composer.json
file. A composer.json
file will be created if one doesn’t exist.
After adding/changing the requirements, the modified requirements will be installed or updated.
Options
--update-with-dependencies (-w)
: Also update dependencies of the newly required packages, except those that are root requirements.--update-with-all-dependencies (-W)
: Also update dependencies of the newly required packages, including those that are root requirements.