Maximize your Laravel blog's potential with SEO best practices and reach 10K monthly clicks on Google.
Preview the course for free
Benjamin Crozat New!
Benjamin Crozat The art of crafting web applications

5 ways to check which Laravel version you are running

Benjamin Crozat — Updated on
Artboard

Hundreds of developers subscribed to my newsletter.
Join them and enjoy free content about the art of crafting websites!

Powered by

Did you ever asked yourself “What laravel version do I have?”

Well, to check which Laravel version you are running, the quickest way is to use the php artisan --version command.

One important aspect of using Laravel is knowing how to check which version you are working with, as different versions can have different features and requirements.

Let’s review the multiple other ways to find out which version of Laravel you are using.

Table of contents

5 ways to check which Laravel version you are running

The about command shows you the version of Laravel

The about command not only displays the Laravel version but also other helpful information about your project, such as the PHP version, Composer version, and cache drivers.

However, it is important to note that the about command is only available in Laravel 8 or later.

php artisan about
 
Environment ................................................................
Application Name ........................................... Benjamin Crozat
Laravel Version ..................................................... 9.43.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

The php artisan about command in Laravel.

The –version flag is the original way

If you are using an older version of Laravel, you can still use the --version flag to display the Laravel version.

This is the original method of checking it before the about command was introduced. The –version flag can be used with any php artisan command to display the Laravel version.

php artisan --version
 
Laravel Framework 9.43.0

The php artisan –version flag in Laravel.

The app() helper has a version() method

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

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

Check inside the composer.json and composer.lock files for laravel/framework version

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.43.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "2ca2b168a3e995a8ec6ea2805906379095d20080"
}
}

The version is also burried inside Laravel’s source code

Open your favorite code editor and search for vendor/laravel/framework/src/Illuminate/Foundation/Application.php. The exact version of Laravel you are using is written in the VERSION constant.

 
class Application extends Container implements ApplicationContract, CachesConfiguration, CachesRoutes, HttpKernelInterface
{
 
const VERSION = '9.43.0';
 
}
Recommended

I show you how to upgrade your Laravel 8 project to version 9 and help you decide whether the return on investment is worth it.

I show you how to upgrade your Laravel 9 project to version 10 and help you decide whether the return on investment is worth it.

Laravel 10 has been released on February 14, 2023. Let's dive into every relevant new feature and change.

Take your code to the next level, thanks to exceptions. Handle errors in a more graceful way within try and catch blocks.

Smaller and even easier than Vue.js, setting up Alpine.js is as easy as copying and pasting a code snippet.

Nailing a Laravel job interview can be a daunting task, but with the right preparation and mindset, you can set yourself up for success.

This is the most comprehensive tutorial about Tailwind CSS. Learn how to make front-end development great again.

Learning a framework can be overwhelming, but time and execution will make you a master. Here are some best practices to help you toward your goal.

Learn why and how to fix "Methods with the same name as their class will not be constructors in a future version of PHP" warnings.

Laravel 11 will be released on February 6th, 2024. Its development is still ongoing. Let's dive into every relevant new feature we know about already.

Powered by