Home » How to Check Laravel Version: 9 Proven Ways to Do That

How to Check Laravel Version: 9 Proven Ways to Do That

Loved it? Please Share on Social Media

Introduction:

Hey, What’s up, everybody? I hope you are doing fine. Today, I will discuss how to check laravel version. I’ve discussed nine proven ways to examine your Laravel application version quickly. You can choose any of these ways that suit you.

Let’s start checking the laravel version using a fresh Laravel application you downloaded earlier. Then, you must follow the rest of the process below.

Check Laravel Version Using Artisan Command:

It is the easiest way to determine your laravel application version. Please type the command into your terminal and hit enter to get the version number.

php artisan --version

after that, you will see the version number like this in your terminal: 

Laravel Framework 10.10

Check Laravel Version by Viewing the Composer.json File:

You can look over your laravel version using your project composer file. Open your composer.json file from the root of your project directory. Then, you will see inside the require section a line like below.

"require": {
        "laravel/framework": "^10.10",
 }

Check Laravel Version Using Composer Command:

Another easy way to examine your laravel version is by using the composer terminal command. Please write the command below into your terminal and hit enter to check your version, Tada!

composer show laravel/framework

Check Laravel Version By Inspecting .env File:

Another way is to determine the laravel version manually by inspecting the .env file. You may find the APP_VERSION variable contains the version number below. 

APP_VERSION =10.10

Check Laravel Version Using Laravel Installer Package:

It is the more sophisticated way to explore your laravel version with a second. Please enter the following command into your terminal and press enter. You will see your appropriate version number there.

laravel --version

after that, you will see the version number like this in your terminal: 

Laravel Framework 10.10

Note: You must have installed the laravel installer globally into your PC to determine the version of your application.

Using Route Way:

You can examine your the number by typing a URL to explore laravel version quickly. We will use the global app function to determine our app version. Please copy and paste the below code snippets into your web.php file.

use Illuminate\Support\Facades\Route;
Route::get('/check-laravel-version', function () {
    return app()->version();
});

Using ServiceProvider Way:

We can check laravel version by using the simple code snippet by pasting it into the AppServiceProvider.php > register function.

$appVersion = app()->version();
echo "Laravel Framework Version: $version";

Check Laravel Version Using Blade File:

We can examine laravel version by creating a seperate blade file for displaying the number. In this case, we will create an app-version-check.blade.php view file, and inside this file, we will copy and paste the below code from here.

<div >Laravel Framework Version: {{ app()->version() }}</div>

Using PHP Constant File:

We can create a separate PHP Constant file to find out the Laravel version. The idea is that we will use the Laravel Application Facade to inspect our Laravel version. Now, copy and paste the code into your code editor.

<?php

require_once __DIR__.'/vendor/autoload.php';
use Illuminate\Foundation\Application;
$appVersion = new Application(__DIR__);
echo "Laravel Framework Version: ". $appVersion->version();

TIPS:

I’ve explained nine ways to check laravel version in this tutorial. Sometimes, some tips will work, and some will not work. You must check every way I’ve told you to follow and practice. You can learn more about this topic from their documentation.

CONCLUSION:

Finished! That’s all about our tutorial. I’ve tried to teach you the most advanced things in this tutorial. Thank you so much for reading the whole tutorial from the beginning. If this tutorial helps you a little bit, then remember to share this post on social media. If you have questions, suggestions, or tips regarding this post, let us know via our Contact Us page.


Loved it? Please Share on Social Media

Leave a Comment


The reCAPTCHA verification period has expired. Please reload the page.