What’s New in Laravel 13 Routing
Laravel 13 keeps the routing model developers already use, where routes map incoming HTTP requests to the code that handles them. This…
Laravel applications rely on Composer, PHP’s dependency manager, to install the framework and any third-party packages the code needs. You write version constraints in composer.json to tell Composer which releases it may pick, and Composer records the exact releases it selects in composer.lock. To keep your dependencies predictable, you set constraints that fit your project, review updates before accepting them, and deploy only the versions that pass your tests.
If you build an application, you commit composer.lock and run composer install so every environment gets the exact same package versions. If you maintain a package, you publish constraints in composer.json that state which Laravel versions your package supports, and you test against those versions. A package’s own composer.lock file never controls which versions downstream applications install.
When you build a Laravel application, commit composer.lock to version control. Whenever you run composer install, Composer reads that lock file and installs the exact package versions recorded in it. That way, your local machine, your continuous integration (CI) runner, and your production server all run the same code. During deployment, run composer install instead of running an unrestricted composer update on the server, which could pull in untested releases. Composer’s basic usage documentation explains how the lock file keeps installs consistent across environments.
A version constraint in composer.json only defines the range of releases Composer is allowed to pick; it does not tell you which version is currently installed. For example, under Composer’s caret-constraint rules, ^2.4 allows any release from 2.4.0 up to, but excluding, 3.0.0. For 0.x releases, Composer narrows that range because pre-1.0 versions can change more freely. You can check the Composer guide to version constraints for the full set of rules.
For the Laravel framework and its first-party components, Laravel recommends a major-version constraint such as ^13.0. That constraint tells Composer to stay within the Laravel 13 major release. The caret operator assumes package authors follow standard versioning conventions, but it cannot guarantee that every release is backward compatible. Review and test updates before you deploy them.
Run composer require when you want to add a new dependency or change an existing constraint. Run composer update when you want Composer to find newer versions that fit your project’s constraints and write those selections to composer.lock. If you pass a package name to composer update, Composer limits the initial update to that package. If you run composer update with no arguments, Composer resolves newer versions for all of your project’s dependencies within their constraints.
composer require vendor/package:^2.4
composer install
composer update vendor/package
composer outdated
composer validate
composer audit
Composer also gives you a few commands to inspect your dependencies before you change anything. composer outdated shows packages with available updates, and composer validate checks composer.json and verifies that the lock file matches it. composer audit checks your installed or locked packages against configured dependency policies, including reported security advisories. An audit report gives you useful information to review, though a clean result does not guarantee that your application is secure. You can read more about how these commands behave in Composer’s command-line reference.
Before you merge an update, inspect the composer.lock diff. A small edit in composer.json can shift other packages too, because Composer evaluates the entire dependency tree at once. That includes transitive dependencies, which are packages required by your dependencies rather than directly by your application. If Composer cannot find a compatible set of versions, run composer prohibits to see which package or platform requirement blocks the version you asked for. Composer treats your PHP version and extensions as platform requirements, so compare them against your production environment before you loosen any constraints. Avoid using --ignore-platform-reqs as a routine workaround, because it skips those checks instead of confirming that production can run the selected packages. See Composer’s documentation on platform dependencies for details.
When you maintain a Laravel package, your constraints in composer.json tell consumers which dependency versions Composer may install alongside your code. For example, a package that supports both Laravel 12 and Laravel 13 can use a union constraint:
{
"require": {
"illuminate/support": "^12.0 || ^13.0"
}
}
This snippet only shows the syntax; it does not mean any given package supports both releases. Add a new Laravel major version to your range only after you have checked your code and tested it against that release. Most Laravel packages rely on a service provider, which is the class Laravel uses to register package services. Laravel’s package development documentation explains how to declare your illuminate/support dependency and configure package discovery so Laravel registers your providers automatically.
Test every version range you claim to support. Composer recommends that library maintainers run CI with composer update to test against newer matching dependencies, and with composer update --prefer-lowest to verify that the package still works at its declared minimum versions. You can use Orchestral Testbench in your test suite to provide a Laravel-like test environment. Even if Composer resolves versions that satisfy your constraints, that alone does not prove your code works at runtime. Composer’s library guidance covers these testing strategies and explains how library lock files differ from application lock files.
As a package maintainer, you may commit composer.lock to keep your own development and test environment consistent. That file does not dictate which versions consumer applications install, because consumers resolve dependencies from their own lock files within the constraints you publish. If you support several Laravel releases at once, document and test every supported combination. A Laravel package support matrix can help consumers see at a glance which versions work together.
A committed lock file holds your application’s dependency versions steady until you choose to update it, so you still need to review updates on a regular basis. Laravel supports each framework release for a set window, and every third-party package follows its own maintenance schedule. As of November 26, 2026, Laravel’s release table lists security fixes for Laravel 12 through February 24, 2027, and for Laravel 13 through March 17, 2028. Those dates only cover the Laravel framework itself, so check each third-party package’s own support policy instead of assuming it matches Laravel’s timeline. You can check Laravel’s release notes for its release dates and support periods.
Semantic Versioning labels releases as MAJOR.MINOR.PATCH. Major releases may include breaking changes, while minor and patch releases are meant to stay backward compatible. Maintainers use this convention to signal what an update changes, but no tool enforces it. The Semantic Versioning specification lays out the rules, and package authors should publish constraints only for versions they have tested. If you are deciding when to hold a version steady or loosen a constraint in your own app, you can also read guidance on pinning Laravel package versions.
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com