Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know Laravel version and where is it defined?

Tags:

laravel

People also ask

How can I check Laravel version?

Every Laravel release has the version of the framework as constant in the Application. php file. You can access this constant via the app() helper. If you don't want to create a /test route to get the version, you can use php artisan tinker to get into the tinker REPL and run it from there.

What is Laravel current version?

The latest Laravel version is version 9, which was released on February 8, 2022.

How do I know my Laravel Composer version?

There are two ways to find the version of your Laravel application . You can either find it by running a command via CLI/ Command Prompt or you can check Laravel version in source files of your Laravel installation.


run php artisan --version from your console.

The version string is defined here:

https://github.com/laravel/framework/blob/master/src/Illuminate/Foundation/Application.php

/**
 * The Laravel framework version.
 *
 * @var string
 */
 const VERSION = '5.5-dev';

  1)  php artisan -V

  2)  php artisan --version

AND its define at the composer.json file

"require": {
        ...........
        "laravel/framework": "^6.2",
        ...........
    },

If you want to know the specific version then you need to check composer.lock file and search For

"name": "laravel/framework",

you will find your version in next line

"version": "v5.7.9",


If you want to know the user version in your code, then you can use using app() helper function

app()->version();

It is defined in this file ../src/Illuminate/Foundation/Application.php

Hope it will help :)


CASE - 1

Run this command in your project..

php artisan --version  

You will get version of laravel installed in your system like this..

enter image description here

CASE - 2

Also you can check laravel version in the composer.json file in root directory.

enter image description here


Step 1:

go to: /vendor/laravel/framework/src.Illuminate/Foundation:

go to: <code>/vendor/laravel/framework/src.Illuminate/Foundation</code>

Step 2:

Open application.php file

Open application.php file

Step 3:

Search for "version". The below indicates the version.

Open application.php file


Run this command in your project folder location in cmd

php artisan --version