Introduction
Installing Laravel on Windows involves setting up PHP, Composer, and the Laravel installer. This guide will help you configure your development environment to start building powerful web applications effortlessly.
Table of Contents |
1. The first step is to install the XAMPP server.
select the third version and set up the Xampp server in C:\ drive
Create a Laravel folder within the htdocs directory inside the XAMPP installation.
2. Install the composer
Composer is a dependency management tool in PHP, widely used in Laravel projects. It allows you to manage and install libraries and packages that your project depends on
visiting composer.org click the download link and complete the setup.
- Next, verify that Composer has been successfully installed on your system. To do this, open the command prompt and type
composer
. If you see an interface similar to the one shown in the images below, then Composer has been installed successfully.
3. Then install Laravel
there are two types of options for installing laravel
one is global installation and second one is pre-project installation
In a global installation, Laravel refers to installing certain tools or packages so that they can be accessed from any project or directory on your system, rather than being installed on a per-project basis. This approach is typically used for tools that will be utilized across multiple projects, rather than for project-specific dependencies.
Laravel Installer: The Laravel installer is a tool that helps you quickly create new Laravel projects. By installing it globally, you can use the
laravel new
command to generate new Laravel applications anywhere on your system.Pre-project installation refers to setting up and installing necessary tools, dependencies, and packages before starting a new project. In the context of Laravel or any other development environment, it ensures that your system is prepared with the required tools and libraries so that you can focus on building your project without facing setup-related issues
- Then visit the laravel official site laravel.com
select the documentation then go to the installation
- open the command prompt and change the directory to the laravel folder that we create inside the htdocs folder.
I am utilizing the global installation process, but you may select the method that best suits your preferences.
And type the command
composer global require laravel/installer
After typing this command, Laravel will be successfully installed on our system.
Then we create a project inside the laravel folder we can type another command.
laravel new example-app
Instead of "example-app," you can specify your project name.
Once the project has been created, start Laravel's local development server using Laravel Artisan's
serve
command:
cd example-app
- Then you can run your project by typing the following command:
php artisan serve
- After running your project, you will see an interface similar to the one shown in the images below.
After navigating to this localhost path, you should see this page, indicating that our project has been successfully created.
Later, you can modify the project folder as needed.
4. Choose your Code Editor
In my case, I am using Visual Studio Code. Please choose the code editor that best suits your needs.
Download the Visual Studio code editor.
Follow for more insightful blog posts tailored to your needs.๐