This workshop will be retired on May 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Having different versions of packages on different environments can cause issues with the application performing differently, and that can make tracking and fixing bugs next to impossible. Composer gives us another tool, a composer.lock file, that tells composer which version to use.
Download the final project
When updating to a patch version, nothing SHOULD break. But if you're trying to track down bugs, you want to make sure that it's not something introduced in someone else's code.
Reminder
When updating composer dependencies, make sure you commit your composer.lock file to Version Control system. DO NOT commit your vendor folder.
Commands
composer install
will look for a composer.lock file first and install the versions specified there. If a lock file does not exist, composer will use the composer.json file to install dependencies.
composer update
will update all packages as well as the composer.lock file.
composer show
will list all installed packages and their versions
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up