W3docs

Installing specific laravel version with composer create-project

To install a specific version of Laravel using the Composer create-project command, you can specify the version number after the package name.

To install a specific version of Laravel using the Composer create-project command, you can specify the version constraint after the package name. For example, to install Laravel version 8.0, you would use the following command:

Example of installing specific laravel version with composer create-project

composer create-project laravel/laravel:^8.0 myproject

This will create a new directory called myproject and install Laravel version 8.0 in that directory.

Alternatively, you can use the --prefer-dist flag to install from a distribution archive instead of cloning the repository:

composer create-project --prefer-dist laravel/laravel:^8.0 myproject

Note that Composer uses semantic versioning constraints. The ^ operator allows updates to any version that does not modify the left-most non-zero digit (e.g., ^8.0 matches 8.0.0 through 8.999.999). Use * to match any version, or specify an exact version like 8.0.0 if you need a strict match.