Creating First Laravel Project
In this topic, we are going to create the first laravel project. To create the Laravel project, we will be using Git and Composer.
Following are the steps required to create a first laravel project:
- Open the Git Bash window.
- Enter the ls command to know the current location.
Currently, we are in the root directory.
- Now we create a Laravel project in Xampp folder. First we need to move to the xampp folder where we create a new laravel project.
In the above screen, cd c: command is used to move to the c drive and then we use the command cd xampp/htdocs/ to move to the xampp folder.
- First, we use the ls command to view the list of projects.
The above screen shows that list is empty, i.e., no projects are available in the xampp folder. Now, we first clear the screen, and create a new laravel project.
- Create a new laravel project.
In the above screen, we use the command composer create-project laravel/laravel firstproject.
where,
laravel/laravel: It is a vendor package.
firstproject: It is a project name.
Note: If we do not mention the version, then composer creates automatically new laravel project with the latest version.
We can also use below commands to create a new laravel project:
- The below screen shows that installation of laravel is started.
- Once the installation of laravel completed, an application key is created.
- After successful installation, move to the xampp/htdocs folder where we find the firstproject.
- Go to the firstproject folder and then click on the vendor folder where you will find all the dependencies.