How to install laravel via composer

Laravel is an open source content management system. It uses composer to manage all kind of dependencies. So the first step to install it to check that composer is properly installed on our machine.

There are 2 ways to install laravel using composer

Using laravel installer

for this installation we have to install laravel installer using composer first. fir this we have to use following command.

 composer global require laravel/installer

Once this installer installed then laravel new commaod will create new project

laravel new your_laravel_project_name

Using Composer Create-Project

second method is that we can install laravel using composer create-project command by using termimal

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

this will install the latest version of laravel on your selected directory.if we want to install the specific version then we need to run following command.

 composer create-project --prefer-dist laravel/laravel  your_laravel_project_name "5.4.*"  

Read more