Laravel 8 | How to Install Laravel 8 in Windows

Laravel is among the top frameworks of PHP. Laravel 8 is the latest version. In this blog, we will learn how to install Laravel 8 in windows.

There are many other ways to install Laravel such as
– Laravel Sail
– Docker
– Composer

Installing Laravel via Composer is the easy way to get Laravel up & running in your windows local machine.

Before Installing Laravel, we need to make sure the below software/packages are installed.
– PHP
– Composer
– MySQL
– Apache (Looking for Hosting Servers? Read More about Top 7 platforms for free web hosting )

Steps to install Laravel PHP.

Step-1: Install Composer.

  • Composer is a package manager just like NPM is for Node, Composer is used for PHP.
  • Go to Composer and download  Composer-Setup.exe
  • Install it.
Installing Composer for PHP
Composer

Step – 2: Install Laravel.

  • Install Laravel globally so that you can use it in anywhere.
composer global require laravel/installer

Step – 3: Create / Scaffold Laravel Application.

  • Install Laravel globally so that you can use it in anywhere.
laravel new itbulls-laravel
  • After the installation of laravel, the folder structure will look something like below

Step – 4: Set Environment Variables & Create Database.

  • Every Laravel Project has a .env file i.e. an environment file. This file contains all credentials of external packages, services that you’re going to use throughout your application.
  • If there’s no .env file, create another one by simply copying the .env.example.
  • Create a Database of your choice, and edit the below variables as per your system in the .env file.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=itbulls
DB_USERNAME=root
DB_PASSWORD=password

Step – 5: Migrate & Serve.

  • After step – 4, we need to create tables in the database. So for doing that, enter below command in Laravel Cli
php artisan migrate
  • Serve the project. Serving the project will lead to starting the development server of laravel to run the project on our local machine.
php artisan serve

And voila! Open up the browser with the localhost:8000

So this is how we set up Laravel in windows. In future, we will be going through other different ways of installing & setting up Laravel.

If you’ve questions regarding what are the advantages of learning Laravel, you can read our article.

Previous Post
Next Post

Comments

Laravel | Host Laravel Application in Heroku - IT Bulls

[…] Make sure to have a (New) Laravel Application ready. (Get started) […]

Leave a Reply

Your email address will not be published. Required fields are marked *