#1. Using the CLI:
php artisan --version
#2. You can display in the blade files:
<ul>
<li>PHP: {{ phpversion() }}</li>
<li>Laravel: {{ app()->version() }}</li>
</ul>
#3. Use the below CLI command to get more than only the laravel version:
composer show laravel/framework
#4. You can also check the composer.json and composer.lock file data:
"require": {
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
}
#5. You can also check from the files vendor/laravel/framework/src/Illuminate/Foundation/Application.php:
const VERSION = '9.43.0';
#6. You can also make a function which you can use to check the version:
This is actually the constant app()->version() uses. 😀
public function version()
{
return static::VERSION;
}