Laravel on Windows: A Complete Guide to Installation and Project Setup


Listen to this article
Rate this post

Laravel On Windows

Are you looking to set up Laravel on your Windows machine? This guide will walk you through the entire process, from installing the necessary software to creating your first Laravel project. With the right tools and steps, you can easily get started with Laravel on Windows 10 or 11.

Prerequisites for Installing Laravel

Before diving into the installation, you need to have a few essential components ready:

  • PHP: You will need PHP installed on your system. We will use WAMP as our server.
  • Composer: This is the dependency manager for PHP that will help you install Laravel.
  • Visual Studio Code: A powerful text editor to write your code.

Step 1: Install WAMP Server

First, you need to install WAMP server, which will help you run PHP on your Windows machine. If you need guidance on installing WAMP, you can refer to this video tutorial.

Step 2: Download and Install Composer

To install Composer, follow these steps:

  1. Open your favorite browser and search for “Composer download”.
  2. Click on the official link getcomposer.org.
  3. Download the composer setup.exe.

Downloading Composer Setup

Once downloaded, run the installer. During installation, it will ask for the path to your PHP executable. If you have WAMP installed, it is usually located in:

C:\wamp64\bin\php\phpX.X.X\php.exe

Make sure to select the appropriate PHP version. After this, you can finish the installation.

Step 3: Install Visual Studio Code

Next, you need to install Visual Studio Code:

  1. Search for “Visual Studio Code” in your browser.
  2. Download it from the official website.

Downloading Visual Studio Code

Run the installer and follow the prompts to complete the installation.

Step 4: Verify PHP and Composer Installation

After installing PHP and Composer, you should verify their installations:

  1. Open the Command Prompt (CMD).
  2. Type php -v to check PHP installation.
  3. Type composer to check if Composer is installed correctly.

Verifying Composer Installation

Step 5: Create a New Laravel Project

Now that you have everything set up, it’s time to create your Laravel project:

  1. Create a new directory for your Laravel projects, e.g., l-workspace.
  2. Open CMD in this directory.
  3. Run the following command to create a new Laravel project:
composer create-project laravel/laravel example-app

Creating Laravel Project

This command will download the Laravel framework and set up a new project named example-app. It may take a few minutes depending on your internet speed.

Step 6: Open the Project in Visual Studio Code

Once the project is created, navigate into the project directory:

cd example-app

Now, you can open the project in Visual Studio Code by typing:

code .

Opening Project in Visual Studio Code

Step 7: Run Your Laravel Application

To run your Laravel application, you need to start the built-in server. In Visual Studio Code, open a terminal and type:

php artisan serve

Starting Laravel Development Server

This command will start your server, and you will see a message indicating the local development URL, usually http://localhost:8000. You can open this URL in your web browser to see your Laravel application running.

Step 8: Modify the Welcome Page

To customize your application, navigate to the resources/views directory and open welcome.blade.php. Replace the existing content with:

Hello WorldEditing Welcome Page

After saving the changes, refresh your browser, and you should see “Hello World” displayed on your screen!

Conclusion

Congratulations! You’ve successfully installed Laravel on your Windows machine and created your first project. Laravel is a powerful framework that allows you to build robust web applications with ease. If you have any questions or run into issues, feel free to write comments.

For more tutorials and coding-related content, consider bookmarking to my website.

For best Youtube service to grow faster vidiq:- Click Me

for best cheap but feature rich hosting hostingial:- Click Me

The best earn money ai tool gravity write:- Click Me

Thank you for following along, and happy coding!

Author Image

Mo waseem

Welcome to Contentvibee! I'm the creator behind this dynamic platform designed to inspire, educate, and provide valuable tools to our audience. With a passion for delivering high-quality content, I craft engaging blog posts, develop innovative tools, and curate resources that empower users across various niches


Leave a Comment

Table Of Contents