Home > OS >  Ambiguous Laravel version
Ambiguous Laravel version

Time:08-05

I am going to start working on existing Laravel project and I checked Laravel version using 2 ways:

  1. I run php artisan --version and Laravel Installer 4.2.10 got printed.
  2. I checked composer.json file and there is laravel/framework": "^8.0.

Which one is real one? Thank you in advance.

PS: This question is not about how to. It is about why 2 different method return 2 different answer.

CodePudding user response:

Search in composer.lock "name": "laravel/framework", for see current installed version enter image description here

CodePudding user response:

  • using php artisan --version to check via CLI.

  • app()->version() to print version in blade template.

CodePudding user response:

To answer your question, the Laravel Installer is the composer laravel installer which allows devs to run

laravel new blog

instead of

composer create-project laravel/laravel:^8.0 blog

Laravel Framework is the one that will advise what version of laravel you are running

  • Related