Downloading XAMPP, Composer, and VS Code
We'll be seeing how to install and set up VS Code, Composer, and XAMPP on your device. So let's start with downloading the XAMPP. So you can see I have opened the website apachefriends.org. You can simply search XAMPP on Google and you can get this website. Now click the download option here, XAMPP for Windows, and it will start downloading.
Now you have to come to the Composer, getcomposer.org, and you have to download the Composer. You can simply search Composer on Google and get to this website. I will also give the link for all this in the description, so you can check that out. So let's click on download, and here you can see composer-setup.exe. So click this link and the download will start. Now that's it. So we have also downloaded the Composer. So now we have downloaded Composer and XAMPP. Now let's download VS Code. So you can simply come to the website code.visualstudio.com. You can also search VS Code and get to this website, and click download for Windows. Now this will start the download for Windows, so I have already downloaded it, so I'm canceling it right now. So you have to download all these three. You can also use PHPStorm if you wish to, because the PHPStorm is having a license. You have to purchase it or you can sign up for student version if you have an email or ID, something you can use that. Okay. I prefer using PHPStorm since it's easy for coding in PHP, but in this video, we'll be seeing how to set up using VS Code because it's more accessible for all. Okay, so let's close this website.
Installing XAMPP on Windows
So now we have downloaded XAMPP, VS Code, and Composer. Now we have to install them. So let's start by installing the XAMPP. Simply double-click on the XAMPP exe file. So here you can see a warning, you can simply click okay and you can click next. And click next. Here you can see the folder to which the XAMPP will be installed. You can see by default it's showing C:\xampp, so it will be installed to the XAMPP folder inside the C drive. So let's keep it the same and click next. Now here you can simply click next, and click next. Now you can see the installation for XAMPP will start. So after this, the XAMPP will be installed on your system. So after installing, you can see this screen. So here you can simply click finish and it will open XAMPP. So you can see the XAMPP is opened. So we have XAMPP installed and ready. So we can minimize this.
Installing Composer and Configuring PHP Path
So now we have installed the XAMPP, so let's start installing the composer.exe. So double click the exe file. You can click run. Here you can select the install for all users. So here you can simply click next. And here you can see the Composer have detected the PHP installation. So here you can see we have installed inside XAMPP, PHP, and we are having the php.exe. So here you can see it is asking you to add PHP to the path. So if you haven't added PHP to your path, you can simply check this option and click next. I have already added PHP to my path so I am not checking this option. If you haven't added PHP to your path and if you are not aware if you have added it or not, so check this option and click next. Here you can simply click next. Now you can see it is asking you to install. So here you can simply click install. So you can see the Composer have installed, so click next, and you can see finish. So we have installed composer now. So we have completed installing XAMPP and then we have installed the Composer, and we have also added PHP to our path, okay? So we have done three tasks.
Installing Visual Studio Code
Now we have to install the VS Code. So simply click on VS Code and it will ask you to run. Click run. So here you have to accept the agreement and click next. So simply click next. Here you can simply click install. Now the VS Code will be installed on your system. So you can click finish, and this will open the VS Code.
Installing the Global Laravel Installer
Here you can minimize the VS Code and go to Laravel documentation. So here you can see laravel.com. Inside the website laravel.com, we can see Get Started. Click on Get Started. Now inside the installation, scroll down. Here you can see composer global require laravel/installer. So we are going to install the Laravel installer globally on our system, okay? So we have Composer installed and ready so you can run this command. We have installed Composer in order to run this command. Okay, so hope you understand. So you can copy this.
And here we have to open a folder. So for that, let's create a folder and open it inside VS Code. Go to file, you can see open a folder. So here you can see I have selected a folder. So you can select this folder and it will open inside VS Code. Now we can go to the terminal. You can go to the top, you can see Terminal and click New Terminal. Now the terminal will open on the bottom. So here we can run the command. So for that go to the documentation and copy this command, paste the command here and click enter. So you can run this command either on the command prompt or we can run it here like this. Since I already have Laravel installer installed, you can see it is saying that it is already installed and nothing is there to update or remove, okay? So you'll be having a different message. So that's all. So now we have added Laravel installer to our system, okay? So this is added globally. So you can access the command laravel from anywhere, okay?
Creating Your First Laravel Project
So now let's try creating a new app. So for that, you have to use the command laravel new followed by the name of the app. So, laravel new, and when you type the name of the application, you should not use any space. So it will be like my_first_app. Now you can hit the enter. So this will create the app. So you can see it is creating the Laravel project. So you can see a folder has been created with the name my_first_app. If you open this you can see many other folders and files. So wait for the installation to complete.
Okay, now our project has been created successfully. Now you can close the terminal. Now we can see how the app is. You can go to the app folder and you can see the folder, you can see HTTP folder, so inside this we are having our controllers, okay? We are also having our models inside the folder app. Okay? So you can see models. Now we can also see the resources, views, and you can see the routes here. Okay? web.php, okay.
Running the Laravel Application
So let's try running this. I will create a course on Laravel later on. So right now let's try running this. For that you have to open the terminal itself. Here you have to type php artisan serve. So here you can see we are accessing PHP. So you have to add PHP to your environment variable. While we are installing the Composer, you might remember that we have added the path of PHP. So that's the step. So because of that, we can access PHP from anywhere, okay? So you have to add the path of PHP. So php artisan serve, okay? Now you can hit enter.
Okay, you can see that the Artisan file is not found because we are not inside the folder my_first_app, okay? For that, you have to go to cd my_first_app. Now you can hit enter. Now here you can type the command php artisan serve. Okay, now you can see the server is running and you are having the link. So you can open this by clicking control plus clicking the mouse here. Okay, so here you can see the Laravel application has opened. So that's all. So now we have installed the Laravel and seen how to run the app. So that's all for this video. Hope you understand how to install Laravel. So if you like this video, give it a thumbs up and subscribe to this channel for more such videos.