10 Steps to Create a Laravel Project on Windows Devices

Laravel is a PHP framework that helps you build your web applications faster and in a more convenient way. It will handle your back end and front end, and it will teach you how to organize your code nicely. Its most significant feature is called MVC (Model, View, Controller), which organizes your code efficiently.

It is easy yet incredibly potent. It possesses helpful tools to help you create enormous and complicated websites, like database management, code testing, and handling different areas of your app smartly. It gives you all the necessary tools to design good, web-based applications. So today, in this article, I will guide you through how to develop your very first project step-by-step. Let’s begin with that.

Requirements for running Laravel

To run a Laravel project on your system, you need to fulfill some requirements, which are:

  • PHP (version 8.1 or higher)

  • Composer (dependency manager for PHP)

  • A Web Server (e.g., Apache, Nginx, or Laravel’s built-in server)

  • A Database (MySQL, PostgreSQL, or SQLite)

Now let’s step by step complete all these requirements.

Installing PHP and Composer in your system

Step 1: Download and install XAMPP on your system. XAMPP is used to get PHP, Apache, and MySQL running on your system

Laravel project create Xampp

Step 2: Download and install Composer on your system.

Step 3: Verify your composer. For this run, the following code in your command prompt.

       composer -v

  Laravel project create composer

Create a New Laravel Project

Now, to create your first project, you need to run some commands in your command prompt, or you can use Git Bash. All these commands are given below, and you can also check out the Documentation for the same commands.

Step 1: Open your directory and open CMD in the root file of that directory.

Step 2: Run the composer project create command in your CMD

composer create-project laravel/laravel ofe

Replace my-first-app with your project name and hit enter.

Laravel project create cmd part 1

It may take a while to download the library on your system, so wait patiently. After a while, the project creation part will end, and you may see a screen like this.

Laravel project create cmd part 2

Step 3: Open your directory, which you used to create your Laravel project, and open the file you named to create the project.

Step 4: Run CMD in that root.

Laravel Project directory run

Step 5: Before running the project, make sure you turn on MySQL and the Apache server in XAMPP.

XAMPP Running

Step 6: Run the serve command in your CMD

PHP ARTISAN SERVE

Step 7: Open the IP address given from the CMD in your local browser.

Laravel Running on browser

Step 8: Create a database using PHPMyAdmin and enter the database name in the .env file, replacing ‘sqlite’ with ‘mysql’.

Step 9: Your project is now ready.

In Conclusion

These were the easiest ways to create your very first Laravel project. I hope that this article was helpful to you.

 

Thank you for being with Code Issue.

 

1 thought on “10 Steps to Create a Laravel Project on Windows Devices”

Leave a Comment