Reader Stacks

How to Find Your Installed Laravel Version

The version in composer.json is only ever a constraint range, never the exact installed version — composer.lock (or php artisan --version) is what actually reflects the specific version currently installed.

How to Find Your Installed Laravel Version

Checking a Laravel project's actual installed version — genuinely necessary before consulting version-specific documentation or reporting a bug — has one common pitfall worth knowing: composer.json never shows the exact installed version, only a constraint range.

The most reliable method: the Artisan CLI

php artisan --version
Laravel Framework 11.9.2

This reads the actual currently installed framework version directly — the single most reliable source of truth, since it reflects reality regardless of what any configuration file happens to say.

Checking programmatically, from within the application

echo app()->version();
{{ app()->version() }}

The common mistake: reading composer.json directly

// composer.json
"require": {
    "laravel/framework": "^11.0"
}

The ^11.0 constraint here means "any version compatible with 11.0, up to but not including 12.0" — it is a version *range* the project accepts, not the specific version actually installed; the real installed version could be 11.0.0, 11.9.2, or anything else within that allowed range.

Finding the exact installed version via composer.lock

grep -A 2 '"name": "laravel/framework"' composer.lock

Unlike composer.json's constraint range, composer.lock records the exact specific version that was actually resolved and installed the last time composer install or composer update ran — this is the file to check for the genuinely precise version if not running the Artisan command directly.

Checking via Composer directly

composer show laravel/framework

Checking PHP's own version, a related but separate check

php -v

The Laravel version and the PHP version are two entirely separate, independent pieces of information — following the multiple-PHP-versions pattern covered elsewhere on this site, a server can easily run several PHP versions side by side, so confirming which specific PHP binary is actually running a given Laravel project (via php -v using the exact same PHP command the app itself uses) matters just as much as the Laravel version itself.

Why this matters before consulting documentation

Laravel's official documentation is versioned, and a meaningful number of APIs, config file structures, and conventions have changed across major versions (the Laravel 11 bootstrap/app.php restructuring being one significant recent example) — following an 8.x-era tutorial against an 11.x project, or vice versa, is a common and avoidable source of confusion that checking the actual installed version first helps prevent.