How to automatically update Laravel composer dependencies?

Published 03 December 2019 20:16 (2-minute read)

As you all know, it's really important to keep all your composer dependencies up-to-date. Laravel has a weekly release, so here are a few ways to check how you can do this!

Composer outdated

With this simple built in command you can check which dependencies are out of date. Just type "composer outdated".

Don't want to see all the external used dependencies? Just add a parameter ("-D") to the command and it shows the direct dependencies used within your project.

Dependabot

Don't want to do this by hand? Dependabot is a script (since May 2019 it's acquired by GitHub) that will check all your dependencies and makes a PR to the repo with the changes.

Bobby Bouwmann made a blogpost about how you can run dependabot in your GitLab CI. In this example he explains how you can auto update your Laravel composer and NPM dependencies by scheduling a GitLab CI job.

You can schedule this as often as you want, but keep in mind, GitLab has a limited amount of minutes you can use each month on their shared runners. It's also possible to add your own GitLab Runners, take a look at their documentation for more information.

Other ways to do this!?

Did I miss one way that can be useful for other developers? Please send it to me via Twitter and I will add it to this blogpost.

Robin Dirksen

Follow me on Twitter, there I post web-related content, tips/tricks, and other interesting things.

On my blog, you can find articles that I've found useful or wanted to share with anyone else.

If you want to know more about this article or just want to talk to me, don't hesitate to reach out.

Sachin mentioned on 5th March 2022