Artisan Laravel Version: A Comprehensive Guide

Artisan Laravel Version: Everything You Need to Know

Apr 14 2025

Artisan Laravel Version: Everything You Need to Know

Checking the Composer.json File

Another way to determine the Laravel version is by inspecting the composer.json file in your Laravel project’s root directory. Composer uses the composer.json file to specify project dependencies.

Navigate to your Laravel project’s root directory. Open the composer.json file, look for the “require” section, and find the entry for Laravel which specifies the version installed.

 "require":  "php": "^8.1", "laravel/framework": "^10.0",  >

In this case, Laravel version 10.0 is installed.

Lister les commandes Artisan Laravel

Artisan propose de nombreuses commandes pour simplifier diverses tâches dans Laravel, comme la création de modèles, la gestion des migrations, et bien plus encore. Pour voir toutes les commandes disponibles, entrez :

  php artisan list  

Explication de php artisan list

  • Affiche toutes les commandes disponibles :Les commandes sont regroupées en catégories commeMigrations,Cache,Queue,Database, etc.
  • Vue d’ensemble rapide :Chaque commande est accompagnée d’une brève description indiquant son rôle.

Voici exemple d’affichage :

Astuce Pratique : Utilisez php artisan list | more pour afficher la liste de commandes page par page si elle est trop longue pour tenir dans une seule page du terminal.

Vérifier la version Laravel avec Artisan

Pour connaître la version exacte du framework Laravel que vous utilisez dans votre projet, vous pouvez exécuter la commande suivante dans le terminal :

  php artisan –version  
  • Cette commande affichera la version actuelle de Laravel installée.
  • Cela peut être utile pour vérifier la compatibilité avec des paquets spécifiques ou pour s’assurer que vous êtes à jour.

Infos : Il est conseillé de garder votre installation de Laravel à jour afin de bénéficier des dernières fonctionnalités, améliorations de performance et correctifs de sécurité.

6 ways to check the version of Laravel

Using the php artisan about command

The about command Artisan offers not only displays the Laravel version but also other helpful information about your project such as the version of PHP you’re running on, Composer’s version, cache drivers, etc.

However, it’s important to note that the about command is only available in Laravel version 9.21 or later.

php artisan about Laravel Version . 11.0.8 PHP Version . 8.3.3 Composer Version . 2.7.1

Using the –version flag with Artisan

I talked about it in the introduction. If you are using an older version of Laravel, you can still use the --version flag to display the Laravel version.

This is the original method for checking it before the about command was introduced. The --version flag has priority over any Artisan command.

php artisan --version Laravel Framework 11.0.8

Or, using the flag with any other command:

php artisan make:model --version Laravel Framework 11.0.8

Using the version() method

The app() helper will give you access to many information, such as the Laravel version you are running. Try this simple code below:

// 11.0.8 app()->version();

You could use it in a custom dashboard you created:

ul> li>PHP: phpversion() >>li> li>Laravel: app()->version() >>li> ul>

Via Composer in your terminal

Composer offers a handy command to check the version of a specific dependency. Run:

composer show laravel/framework

You will get an incredibly lengthy report about this dependency.

name : laravel/framework descrip. : The Laravel Framework. keywords : framework, laravel versions : * v11.0.8 released : 2024-03-21, this week type : library license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText homepage : https://laravel.com source : [git] https://github.com/laravel/framework.git 0379a7ccb77e2029c43ce508fa76e251a0d68fce dist : [zip] https://api.github.com/repos/laravel/framework/zipball/0379a7ccb77e2029c43ce508fa76e251a0d68fce 0379a7ccb77e2029c43ce508fa76e251a0d68fce …

Chhaya Mehrotra

Tegs: