Is Using The Command "composer Create-project Laravel/laravel [name Of My Project]" The Correct Way Of Creating A New Laravel Project?

- 1 answer

When creating a Laravel project I use the command "composer create-project laravel/laravel [name of my project]". It takes more than 5 minutes to create and also installs Laravel. Is this the correct way of creating a new Laravel Project?



To create a new Laravel Project via composer we need to install laravel first. Below command is used to download and install laravel using composer.

composer global require laravel/installer

Once Laravel get installed on your pc larevel new command will create a fresh Laravel installation in the directory you specify.

laravel new Project_name

Also you can create new laravel project via composer as well. (I Used to create via Composer). You can run the below command in your terminal to create new laravel project.

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

It will take couple of minitues to create the project. Once it done go the the project directory and run the command php artisan serve to start the development server at http://localhost:8000:

Refer Laravel Documentation for more information.