Ambiguous Laravel version - laravel

I am going to start working on existing Laravel project and I checked Laravel version using 2 ways:
I run php artisan --version and Laravel Installer 4.2.10 got printed.
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.

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

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

using php artisan --version to check via CLI.
{{ app()->version() }} to print version in blade template.

Related

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0"

I upload my laravel project on azure. However when I go to the link I got this error. My project php version is 8.0.0 and my azure php version is 7.4.11. How can I can increase the version on my azure php.
If you are deploying your application, you need to update your php version to php version 8
I have the same problem and now it already solve.
Check PHP version commend # php --version
If your PHP 7.4 you need to commend in your laravel project # composer update
If you php >=8.0.0 you need to install php 7.4 and commend in your laravel project # composer update
Simply go to vendor/composer/ , then you will find platform_check.php file. Just open it and comment full code. Save it. That's it. You can now use it with lower php verson.

Why is my laravel installer version still 2.1.0?

When it i first time installed laravel using
composer global require laravel/installer
it shows the version of 2.1.0 not the latest version?
How to fix this problem? i know i can install specific laravel version with
`composer create-project laravel/laravel="6.0.*" appName`
It's annoying cause in the terminal it still shows the version of 2.1.0
The latest version of Laravel installer as of the moment is 2.1.0. Just take note that it is not same with the Laravel framework that will be installed. They're two separate entities.
hat it is not same with the Laravel framework
laravel -V
it gives you laravel installer version
php artisan --version
You get laravel framework version.For you then show it laravel framework 6.

Error on installing backpack for laravel 6.0.3

I did a fresh Laravel 6.0.3 install on laragon and I am trying to install backpack.
I did
composer require backpack/crud correclty
but then when I tried to do the next step
php artisan backpack:base:install
I get an error
Symfony\Component\Process\Exception\ProcessFailedException : The command "composer require backpack/generators --dev" failed.
Exit Code: 2(Misuse of shell builtins)
I tried to delete the cache, to add timeout 600 and I do not know what else to do.
There was indeed a problem with installing backpack/generators - composer did not fall back to an appropriate version, but it is now fixed. You should be able to run php artisan backpack:base:install without problems.
If you hit any roadblocks during the installation, I recommend you follow the manual installation procedure, instead of php artisan backpack:base:install.
Backpack v3.4 is a collection of packages for Laravel 5.5 / 5.6.
Right under requirement in Backpack.io it says it requires laravel 5.5 or 5.6 and PHP7.
It's not compatible with laravel 6.*

Determine if updating Laravel version was successfull

After updating Laravel from 5.1 to 5.2, using composer update command, files composer.json and composer.lock have correct versions (5.2) written under laravel/framework. But the problem is, once I run php artisan --version in CLI it outputs Laravel Framework version 5.1.45 (LTS) and that confuses me.
Is there a way to be sure which version is now installed and being used?

Difference in files laravel install local & on server

When I install laravel on the server via the command:
cd httpdocs/ && /opt/plesk/php/7.1/bin/php /usr/lib64/plesk-9.0/composer.phar create-project laravel/laravel --prefer-dist
I am missing files and folders in the laravel directory, which I would have when I install laravel local on my laptop with the command:
composer create-project laravel/laravel --prefer-dist
The commands are the same, but why am I missing files on the server? Example of a missing file: /app/Http/routes.php and missing folder: /app/events/
In both situations laravel works and shows the default laravel page when I visit the url.
Hope to get a clear answer, I couldn't find it on google or here on stackoverflow.
Just tested this. When using composer create-project, it looks like it will use the maximum version it can while satisfying project requirements.
Therefore, if you're installing using PHP 7.1, it will be able to install the latest, Laravel 5.6. However, if you're running create-project using PHP 5.6, it will only attempt to install Laravel 5.4 since Laravel 5.5 requires PHP 7.0 and 5.6 requires 7.1.
This leads me to believe you don't have a recent version of PHP set up on your local system.

Resources