How to know Laravel version and where is it defined?
Is Laravel version is defined inside my application directory or somewhere in global server side directory?
UPDATE
Sorry, the main question is where the version is defined? Where does
php artisan --version
takes it's answer?
UPDATE 2
The goal is to investigate, who (of us) has changed Laravel version on our site. Could it be changed by github repository edition only? Or server write access was also required?
This question is related to
laravel
Yet another way is to read the composer.json file, but it can end with wildcard character *
You can also check with composer:
composer show laravel/framework
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 :)
In your Laravel deployment it would be
/vendor/laravel/framework/src/Illuminate/Foundation/Application.php
to see who changed your Laravel version look at what's defined in composer.json. If you have "laravel/framework": "5.4.*", then it will update to the latest after composer update is run. Composer.lock is the file that results from running a composer update, so really see who last one to modify the composer.json file was (hopefully you have that in version control). You can read more about it here https://getcomposer.org/doc/01-basic-usage.md
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",
...........
},
Run this command in your project folder location in cmd
php artisan --version
Source: Stackoverflow.com