Introduction: Setting up a development environment is crucial for efficient web development, especially when working with Laravel, a popular PHP framework. In this tutorial, we will guide you through the process of configuring a Windows machine for Laravel website development. We will cover the installation of Laragon, Composer, and Git Bash, three essential tools that will streamline your workflow and enhance your productivity. Let's dive in!

Prerequisites: Before we begin, make sure you have the following prerequisites:

  1. Windows operating system (Windows 10 or later)
  2. Internet connection

Step 1: Laragon Installation Laragon is a powerful development environment that offers a complete stack for Laravel development. Here's how to install it:

  1. Visit the Laragon website (https://laragon.org/) and download the latest version of Laragon.
  2. Run the downloaded installer and follow the on-screen instructions.
  3. Choose the Laragon installation directory and click "Next."
  4. Select the components you wish to install (e.g., Apache, MySQL, PHP), and click "Next."
  5. Choose the desired PHP version and additional tools if needed.
  6. Select the preferred text editor (e.g., Sublime Text, Visual Studio Code) or leave it as the default.
  7. Click "Install" and wait for the installation process to complete.

Step 2: Composer Installation Composer is a dependency management tool used in Laravel projects. Here's how to install Composer:

  1. Visit the Composer website (https://getcomposer.org/) and download the Windows installer.
  2. Run the installer and follow the on-screen instructions.
  3. Select the installation location (e.g., C:\ProgramData\Composer).
  4. Choose the PHP executable used by Composer (the Laragon PHP path: C:\laragon\bin\php\php-{version}\php.exe).
  5. Click "Next" and wait for the installation process to finish.
  6. Verify the installation by opening a new command prompt and running composer --version. You should see Composer's version information.

Step 3: Git Bash Installation Git Bash provides a command-line interface for executing Git commands on Windows. Here's how to install it:

  1. Visit the Git for Windows website (https://gitforwindows.org/) and download the Git Bash installer.
  2. Run the installer and follow the on-screen instructions.
  3. Select the installation location (e.g., C:\Program Files\Git) and click "Next."
  4. Choose the desired components (e.g., Git GUI, Git Bash) and click "Next."
  5. Select the preferred default branch name and line ending conversions.
  6. Choose the terminal emulator used by Git Bash (e.g., Windows Terminal, MinTTY).
  7. Click "Next" and wait for the installation process to complete.

Step 4: Configuring Laragon and Composer Now that Laragon, Composer, and Git Bash are installed, let's configure them:

  1. Launch Laragon and click the "Start All" button to start the Apache and MySQL services.
  2. Open Git Bash by searching for "Git Bash" in the Start menu.
  3. In Git Bash, navigate to the Laravel projects directory using the cd command (e.g., cd C:/laragon/www).
  4. Clone an existing Laravel project or create a new one using the Laravel installer (composer global require laravel/installer).

Within the Laragon www folder:

  1. Open Git Bash by searching for "Git Bash" in the Start menu.
  2. Navigate to the Laragon www directory using the cd command. By default, Laragon's www directory is located at C:/laragon/www. Use the following command:
cd C:/laragon/www

Once inside the www directory, you can create a new Laravel project using the Laravel installer. Run the following command:

composer create-project --prefer-dist laravel/laravel your-project-name

Replace your-project-name with the desired name for your Laravel project. This command downloads the Laravel framework and sets up a fresh installation within a new directory with the specified name.

Composer will begin downloading and installing the necessary Laravel components and dependencies. This process may take a few minutes, depending on your internet connection speed.

After the installation is complete, navigate into the newly created project directory using the cd command. For example:

cd your-project-name

Congratulations! You have successfully created a new Laravel project within the Laragon www folder. You can now start developing your Laravel website using Laragon's built-in development environment.

Remember to start Laragon's services (Apache and MySQL) by clicking the "Start All" button in the Laragon interface before accessing your Laravel project through a web browser.

You can now proceed with Laravel development, leveraging Laragon, Composer, and Git Bash to enhance your workflow and build amazing Laravel websites. Happy coding!

Techie Mike
Techie Mike
Self-taught techie, with a passion for computers and all the cool things you can do with them. Techie Mike, B.Eng. B.Sc.
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Techie Mike - The IT guy in Thailand.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.