A Comprehensive Guide to Finding Your Laravel Version
Laravel provides an option to use the php artisan
command to determine the exact version of Laravel being used in your application.
In this article, we will explore how to use the -v
or --version
option to retrieve the current version of your Laravel application.
Get Laravel Version with --version
Option
This command displays the version of the Laravel application.
Syntax
php artisan --version
Example Output:
Laravel Framework 11.0.8
You can also use the php artisan
command without any options to retrieve a list of all supported commands, which includes version information.
Additional Methods to Check Laravel Version
- Using
php artisan about
: This command provides not only the Laravel version but also other useful project information (available in Laravel 9.21 and later).
php artisan about
- Via Composer: You can check your Laravel version directly from your terminal with:
composer show laravel/framework
In Code: You can access the Laravel version programmatically:
echo app()->version();
In
composer.json
: Check for the required Laravel version in yourcomposer.json
file:
"require": {
"laravel/framework": "^11.0"
}
- Source Code: You can find the exact version in the source code by looking for the
VERSION
constant in:
vendor/laravel/framework/src/Illuminate/Foundation/Application.php
Happy coding! 😄
With ❤️ from 🇮🇳