Whether you're debugging, upgrading, or simply working on an existing Laravel project, knowing the Laravel version is a crucial first step. This blog will walk you through all the methods to check your Laravel version quickly and reliably.
🧾 Why It’s Important to Know Your Laravel Version
- ✅ To check compatibility with PHP or other packages
- ✅ To update or debug based on documentation
- ✅ To ensure you're following the correct Laravel practices
🛠️ Method 1: Using Artisan Command
The easiest way is to use the built-in Artisan CLI.
📌 Step:
Open your terminal and navigate to the root directory of your Laravel project, then run:
📤 Output:
🛠️ Method 2: Using composer.json
File
You can also check the Laravel version by viewing the dependencies listed in the composer.json
file.
📌 Step:
Open composer.json
in your project root and find the laravel/framework
line under the require
section:
📍 Note: This shows the version constraint, not the exact installed version.
🛠️ Method 3: Check composer.lock
File (Exact Version)
To get the exact installed version, check the composer.lock
file.
📌 Step:
Search for laravel/framework
in composer.lock
:
🛠️ Method 4: Using PHP Code (Programmatically)
You can check the Laravel version via code using the Application
class.
📌 Code Example:
Place this in a route or controller to output the version:
🛠️ Method 5: Laravel Version in the bootstrap/cache
Folder (Optional)
Some Laravel versions cache the framework version in compiled files — though not always visible or accurate. Stick with the above four methods for reliability.