How to create Laravel project with spesific version

Normally if you don't specify the laravel version when creating laravel project with composer, it will choose the latest version of laravel, so what if i want to use older laravel version?

You need to specify the laravel version you want to use on the command, such as 4.2, 5.0, 5.1, etc. Here's an example creating laravel project with specific version.

composer create-project laravel/laravel=[laravel_version] [project_name] --prefer-dist

Depending on your composer installation, you can also use composer.phar instead of just composer, like this:
composer.phar create-project laravel/laravel=[laravel_version] [project_name] --prefer-dist

composer create-project laravel/laravel=4.2 my-project --prefer-dist
composer create-project laravel/laravel=5.0 my-project --prefer-dist
composer create-project laravel/laravel=5.1 my-project --prefer-dist
composer create-project laravel/laravel=5.2 my-project --prefer-dist

Note: if you are developing laravel on ubuntu, you might want to run with sudo command
sudo composer create-project laravel/laravel=4.2 my-project --prefer-dist

No comments :

Post a Comment

Leave A Comment...