Discovering the Laravel version of your project is crucial for effective development. Whether you're inheriting code or collaborating with a team, understanding the version ensures compatibility and facilitates efficient project management.
Here, we cover how to check what version of Laravel a project is on, using either the Artisan command, the framework application file, or the composer.json file.
Related Articles
Manually Install Laravel
View Laravel Error Logs
Via Artisan
-
SSH into the server
- Run the command
cd public_html
NOTE: This is to change the directory into the project's root directory.
REPLACE: public_html with the project's root directory.
TIP: This is typically the site's document root. - Run the command
php artisan --version
EXAMPLE:[userna5@ecngx235 ~]$ cd public_html/project [userna5@ecngx235 project]$ php artisan --version Laravel Framework 10.40.0
Via Framework Application File
-
SSH into the server
- Run the command
cd public_html
REPLACE: public_html with the project's root directory.
TIP: This is typically the site's document root. - Run
cat vendor/laravel/framework/src/Illuminate/Foundation/Application.php | grep "const VERSION"
NOTE: This will give you the version of the application that you are using.
EXAMPLE:cat vendor/laravel/framework/src/Illuminate/Foundation/Application.php |
grep "const VERSION" const VERSION = '10.40.0';
Via Composer.json
- Log into the cPanel
- Navigate to the File Manager, located in the Files section
- Navigate to the project's root directory
TIP: This is typically the site's document root. - Edit the composer.json file
- Locate the require section in the code
- Note the laravel/framework version
EXAMPLE: In this example, the Laravel framework version is 10.10."require": { "php": "^8.1", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.10", "laravel/sanctum": "^3.3", "laravel/tinker": "^2.8" },
Comments
0 comments
Article is closed for comments.