The first thing required for installing Laravel with Composer is to have Composer installed on your machine. After that, you have to download the installation package for Laravel in Composer. You can do this using the following command:

composer global require laravel/installer

If the command is completed successfully you will see an output similar to the one shown below:

Complete requirement for Laravel installer in Composer

You can create a new Laravel application using one of the following ways:

  • Open the directory where you want to put your application and enter the command “laravel new”. This will install Laravel in the current directory.
  • Using the command “laravel new <project>”. It will create a directory with the name <project> and install the application inside it.
  • Using the command “composer create-project –prefer-dist laravel/laravel <path>. The <path> is the location where you want to install Laravel.

After the installation is completed you will see an output like the one shown below:

Complete Laravel installation
Complete Laravel installation

Was this article helpful?