Home / Snippets / How to Check Laravel Version (Full Guide)
How to Check Laravel Version (Full Guide) cover

How to Check Laravel Version (Full Guide)

318

3 years ago

0 comments

There are several ways to check Laravel versions and they are through
  • command line
  • programmatically from code
  • composer.json file
  • helper methods

Method 1: Laravel Check Version from Command Line


To check version from the command line you can use the command below.
php artisan --version
or the slightly shorter is:
php artisan -v
Laravel Check Version Using Command Line

Method 2: Laravel Check Version Programmatically from code


To check the version from Laravel code you can define your code below. Create a route in web.php and then call the "app()->version()" helper.
<?php

Route::get('get-laravel-version', function () {
    app()->version();
});
Laravel Get Version Programmatically

Method 3: Laravel Check Version Via Composer.json


The 3rd method is to check from the composer.json file itself, you can inspect the Laravel version.
Laravel version from composer.json

Method 4: Laravel Check Version Via Helper methods


This is like the 2nd method but you can easily call it from within the tinker command.
php artisan tinker
Then from the interactive shell, you can run the helper below.
app()->version()
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this