There are more than one ways to create a new Laravel project. And there are multiple types of Laravel applications that you can create. One good example is, depending upon the options you choose or parameters you pass at the time of project creation, you can choose to create an app with or without authentication already integrated into the app from the beginning.
My method of choice of creating a new Laravel Project is via composer.
If you don’t already know what composer is, it is a PHP dependency manager that helps you download and set up all the dependencies you need for a Laravel (in our case) project to run. For more, I recommend you have a look here. You will need composer installed before proceeding with the steps below.
Create a new Laravel Project via Composer
If you are on Mac, open up your terminal, go to the folder where you want your new Laravel project to be created, and type in the following command:
composer create-project –prefer-dist laravel/laravel projectName
If you are on a Mac and if the above command doesn’t work, use the command below:
composer create-project laravel/laravel projectName
If you are on Windows, I suggest you use something like GitBash (my favorite) or you can use Windows Powershell and type the same command given above, once you are inside your preferred folder where you want to create your project.
It will take a while but once the composer finishes downloading and installing your project, your vanilla Laravel project is ready to run.
Also Read: How to send Notifications in Laravel?
In order to run your application in the browser, move to your newly created project folder by typing the following command:
Once you are inside your project folder, projectName in this case, type the following command to run your project:
php artisan serve
Then, go to your favorite browser and type:
You should see your newly created Laravel application up & running!