Laravel 5.3 framework has been just released. I won’t focus on new features about it right now, I will just make it clear how to install different versions of Laravel without a problem as for many especially new developers it causes problem. As Composer is standard for installing dependencies let’s use this method to install new Laravel applications.
To create brand new Laravel project we will use composer create-project
command (in command line). You will need to have obviously installed Composer itself.
Installation of Laravel 5.3 application
Ok, so when we want to install latest stable Laravel application we can use:
1 |
composer create-project laravel/laravel your-project-name |
As your-project-name you should obviously put something else – the whole application will be put into this directory. Using this command we’ve just installed latest version of Laravel 5.3 application as it’s current master branch for Laravel.
Okay, but what in case we want to install some other version of Laravel application? Is it possible at all? Sure, we can add one extra argument to command with Laravel application version.
To install Laravel 5.3 with this method, we should use:
1 |
composer create-project laravel/laravel your-project-name 5.3.* |
Mind that we haven’t used 5.3 here but 5.3.* . What’s the difference? If we use 5.3 in fact we tell to install 5.3.0 version what is probably fine at the moment but in future when Laravel application will be updated we would have installed outdated version out of the box and we don’t want it. So we should in this case choose 5.3.* to make sure we will have installed latest Laravel 5.3 application.
Installation of previous Laravel versions
Ok, so what about installing any other versions of Laravel? Well, it works exactly the same, we should again pass the version we are interested in.
So to install Laravel 5.2 we should use:
1 |
composer create-project laravel/laravel your-project-name 5.2.* |
to install Laravel 5.1 we should use:
1 |
composer create-project laravel/laravel your-project-name 5.1.* |
to install Laravel 5.0 we should use:
1 |
composer create-project laravel/laravel your-project-name 5.0.* |
and to install Laravel 4.2 we should use
1 |
composer create-project laravel/laravel your-project-name 4.2.* |
What about installing upcoming versions? Well, as usually upcoming version is put into dev-develop branch, all we do to pass this branch name again:
1 |
composer create-project laravel/laravel your-project-name dev-develop |
At this moment when we run this we should be able to install Laravel 5.4 application.
Installation when Laravel 5.4 is released
And what when new Laravel version will be released? Let’s assume in 6 months Laravel 5.4 will become stable version and Laravel 5.5 will be in development. Then, when we use:
1 |
composer create-project laravel/laravel your-project-name |
you will create new Laravel 5.4 application and running
1 |
composer create-project laravel/laravel your-project-name dev-develop |
will install Laravel 5.5 application.
I hope this will be post will be helpful for anyone who has problems with understanding about installing different version of Laravel.
MarPlo
Thank you, it was useful to install the next dev. version: 5.5.
hwwa
Thank you, this is very useful for me.
Guru DJ
How about if we want to install two different version of laravel on the same machine?
Marcin Nabiałek
It’s not a problem. You can use those command in 2 different directories so you can install multiple Laravel applications and each of them might be using different Laravel version
Ashwani Bansal
Thank you so much @Marcin Nabiałek.
Its really helpful.
gian phoi thong minh
Thanks for share usefull infomation for me to config lavarel 5.2 .
Oleg
Thanks for the tip. It helped