Benjamin Crozat's blog

Everything PHP & Laravel

5 easy ways to check which Laravel version you are running

Benjamin Crozat's avatar. Benjamin Crozat, published on — 2 minutes read

As soon as you get a new Laravel project to work on, the first thing you should do is to check which version you are running. For instance, you may need to install a new package and you want to make sure it is compatible with your version of Laravel.

Check your Laravel version on Laravel 9 and later with the about command

The about command gives you the Laravel version you are running as well as a lot of other information about your project.

php artisan about
 
Environment ................................................................
Application Name ........................................... Benjamin Crozat
Laravel Version ..................................................... 9.29.0
PHP Version ......................................................... 8.1.10
Composer Version ..................................................... 2.4.1
Environment .......................................................... local
Debug Mode ......................................................... ENABLED
URL .................................................... benjamincrozat.test
Maintenance Mode ....................................................... OFF
 
Cache ......................................................................
Config .......................................................... NOT CACHED
Events .......................................................... NOT CACHED
Routes .......................................................... NOT CACHED
Views ............................................................... CACHED
 
Drivers ....................................................................
Broadcasting ........................................................... log
Cache ................................................................ redis
Database ............................................................. mysql
Logs ........................................................ stack / single
Mail .................................................................. smtp
Queue ................................................................. sync
Session .............................................................. redis

Check your Laravel version with the –version flag on Artisan

Before Laravel blessed us with the about command, it was also possible to check your project’s Laravel version like so:

php artisan --version
 
Laravel Framework 9.29.0

Check your Laravel version with the app() helper

The app() helper will give you access to many information, such as the Laravel version you are running. Try this simple code below:

// 9.28.0
app()->version();

Check your Laravel version in your composer.json and composer.lock files

In your composer.json, you will be able to get the minimum version of Laravel your project is locked on:

"require": {
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
},

As you can see, this project is locked on Laravel 9.19.0 or earlier.

But this might not be enough. Search for “laravel/framework” inside your composer.lock file to get the exact Laravel version that’s installed on your project :

{
"name": "laravel/framework",
"version": "v9.30.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "2ca2b168a3e995a8ec6ea2805906379095d20080"
}
}

Check your Laravel version with Tinkerwell

Do you use Tinkerwell? It’s a must-have application for Laravel that runs on Mac, Linux and Windows. The version of Laravel your project is using is visible at the bottom left of the application.

Screenshot of Tinkerwell.