How to check the version of Laravel

"Learn how to check your laravel version using the command line, with an example."

Checking the Laravel Version

It is important to know what version of Laravel you are using, as this can determine the features available to you and how you interact with the framework. Here is a quick guide on how to check the version of Laravel you are using.

Using the Command Line

The quickest and simplest way to check your version is to use the command line. In order to do this, you need to open up your terminal and type the following command:

php artisan --version

This should output the version of Laravel you’re currently using. It should look something like this:

Laravel Framework 5.7.28

Using the Composer File

If you don't have access to your terminal, you can still check the version of Laravel you are using by looking at the composer.json file located in the root directory of your project. Open up the file, and look for the following line:

"laravel/framework": "5.7.*"

This should give you the version of Laravel you are using. In this example, it is 5.7.

Using the Application File

Finally, if you don't have access to the command line or to the composer.json file, you can still check the version of Laravel you are using by looking at the app/Providers/AppServiceProvider.php file located in the root directory of your project. Open up the file, and look for the following line:

$this->app->version();

This should give you the version of Laravel you are using. In this example, it is 5.7.

By following these simple steps, you can easily check the version of Laravel you are using. Knowing the version of Laravel you are using can help you ensure you are using the latest features, and can help you troubleshoot any issues you might be having.

Answers (0)