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
Laravel 404 Error
Via Artisan
- SSH into the server
- Change directory into the project's root directory by running
cd public_html
REPLACE: public_html with the project's root directory.
TIP: This is typically the site's document root. - Use Artisan to check the version by running
php artisan --version
EXAMPLE:[userna5@whub ~]$ cd public_html/project [userna5@whub project]$ php artisan --version Laravel Framework 10.40.0
Via Framework Application File
- SSH into the server
- Change directory into the project's root directory by running
cd public_html
REPLACE: public_html with the project's root directory.
TIP: This is typically the site's document root. - Check the Application.php file for the version by running
cat vendor/laravel/framework/src/Illuminate/Foundation/Application.php | grep "const VERSION"
EXAMPLE:[userna5@whub ~]$ cd public_html/project [userna5@whub project]$ 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
- 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" },