skip to Main Content

I have updated my PHP version to 7.2 and changed the Laravel version in the composer.json file to 5.7.*

I then ran composer update in the console and want to make sure that Laravel updated (I didn’t see the outcome of the command since I sent the request to my hosting team)

Is there a way to know for sure which version is running?

2

Answers


  1. You can View current Laravel version through Blade Templates

    First way:

    {{ App::VERSION() }} 
    

    Second way:

    <?php
         echo $app::VERSION;
    ?>
    

    Also, the Laravel version installed can be checked in the command line:

    php artisan --version
    

    This will show you which Laravel version is currently running.

    Login or Signup to reply.
  2. 1) Using terminal.

    php artisan --version or php artisan -V

    2) Using in Files go to /vendor/laravel/framework/src/Illuminate/Foundation/Application.php

    enter image description here

    3) Using the blade template.

    {{ App::VERSION() }}
    

    4) Using composer.json

    "require": {
            "php": ">=7.1.3",
            "laravel/framework": "5.6.*",
        }
    

    5) Using route.php file

    Route::get('laravel-version', function()
    {
        $laravel = app();
        echo "Your Laravel version is ".$laravel::VERSION;
    });
    

    Check with url yourdomain.com/laravel-version

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search