How to check the Laravel version in your project
Laravel, known for its elegant syntax and developer-friendly features, is one of the most popular PHP frameworks for building web applications. As your Laravel project evolves, it becomes essential to keep track of the framework's version for compatibility and security reasons. In this guide, we'll explore various methods to effortlessly check the Laravel version within your project.
Utilizing Artisan Command: Laravel provides a built-in command-line interface called Artisan, which offers a quick way to check the framework's version. Open your terminal or command prompt, navigate to your Laravel project directory, and execute the following command:
php artisan --versionThis command will display the Laravel version installed in your project.
Using Helper Method:
check the version using the helper method
app()->version()Checking Composer Dependencies: Laravel projects typically include a composer.json file that lists all dependencies, including the Laravel framework itself. You can inspect this file to find the installed Laravel version. Look for the laravel/framework package within the require or require-dev section:
"require": {
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4",
"laravel/framework": "^8.0",
// Other dependencies...
}
Hope, it will help you get/retrieve Laravel version.
Connect with KoderSolution 🚀
Master modern software engineering, scalable architectures, and advanced backend systems.
Read more architectural deep-dives, systems tutorials, and engineering guides on kodersolution.com.
Subscribe to @kodersolution for concise, animated system design breakdowns and technical shorts.
Follow our official page for daily development tips, architecture discussions, and community updates.
Recommended Resources & Courses
Callum Davies
PHP & Laravel practitioner since v5.4. Big believer in thin controllers, explicit return types, and boring modular architecture that doesn't page you on weekends.