Check Current Laravel Version of Your Project

In this article, we are going to learn how to check the current Laravel version of any Laravel project. Let's get started.

Table of Contents

  1. Artisan Command
  2. From composer.json File
  3. Using version() Method
  4. From Source Code

Artisan Command

We can check the current Laravel version using some artisan commands. First command:

php artisan --version

Laravel Framework 10.24.0

We can also add --version command with any artisan command:

php artisan make:model --version

Laravel Framework 10.24.0

We can also use this command:

php artisan about

Application Name ..................................... Shouts
Laravel Version ...................................... 10.24.0
PHP Version .......................................... 8.1.10
Composer Version ..................................... 2.4.2

From composer.json File

From the composer.json file, we can see the minimum version of Laravel.

composer.json
"require": {
    "php": "^8.1",
    "guzzlehttp/guzzle": "^7.2",
    "laravel/framework": "^10.10",
    "laravel/sanctum": "^3.2",
    "laravel/tinker": "^2.8"
},

Using version() Method

Using the app() helper, we are able to check current Laravel version:

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

From Source Code

Navigate to the Laravel web root directory. Open the file and search for the string VERSION:

vendor/laravel/framework/src/Illuminate/Foundation/Application.php
class Application extends Container implements ApplicationContract, CachesConfiguration, CachesRoutes, HttpKernelInterface
{
    /**
     * The Laravel framework version.
     *
     * @var string
     */
    const VERSION = '10.24.0';
}