What is a composer in Laravel

1. I go to the composer download https://www.phpcomposer.com/

 

 

 

 

After downloading the installation, select the installation in the exe file that corresponds to your own PHP

 

2. Download and install laravel.

 

There are two ways to install Laravel.
The first is to use the Composer build project directly.

composer create-project --prefer-dist laravel / laravel bjyblog

The second way is to use the Laravel installer.

 

Various new projects will be available in the future.

As specifically goes, the composer is not installed above

 

We open cmd to see if we have it installed

 

 

Then cut into the directory we want to install

 

In the following we use Composer to install a test project

laravel new test

The test file is, we go in and open it

The installation was successful. However, I found a problem. I want to install version 5.1. This installation uses the latest version by default. Let's look at that.

The newest one is actually 5.7.

Let's install version 5.1

composer create-project laravel / laravel test1 --prefer-dist "5.1. *"

 

composer create-project laravel / laravel your-project-name --prefer-dist "5.1. *"

Show that this is installed

Finally, it shows that the installation is successful