Knowing the Laravel version you are working with is essential for ensuring compatibility with various packages, maintaining your project’s security, and following the best practices in web development. This guide will cover multiple methods to check the Laravel version in different environments and scenarios.
Table of Contents
How to Check Laravel Version in Command Prompt
To check the Laravel version via the command prompt, follow these steps:
- Open your command prompt or terminal.
- Navigate to your Laravel project’s root directory.
- Run the following command:
php artisan --version
How to Check Laravel Version in File
Another method to check the Laravel version is by examining the composer.json
file located in your project’s root directory. Follow these steps:
- Open the
composer.json
file with any text editor. - Look for the line containing
"laravel/framework"
under therequire
section. - The version number specified next to
"laravel/framework"
is the Laravel version your project is using.
How to Check Laravel Version in cPanel
If your Laravel project is hosted on a server and you have access to cPanel, you can check the Laravel version through the File Manager. Follow these steps:
- Log in to your cPanel account.
- Go to the File Manager.
- Navigate to your Laravel project directory.
- Open the
composer.json
file. - Look for the line with
"laravel/framework"
under therequire
section.
The version number next to "laravel/framework"
indicates the Laravel version.