CRC-Blogs

How to Install and Setup Laravel 5.7 On Windows 10 Using XAMPP

1. Install XAMPP

To install Laravel 5.7 or above version, Download the updated version of PHP i.e., 7.3.*

Following is the link to install XAMPP server

https://www.apachefriends.org/download.html

2. Start Apache and MySQL

After successful installation of Apache server and MySQL DB, Start both of them from XAMPP Control Panel.

3. Install Composer

The composer is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. So, we need to install composer before installing Laravel. Just follow the below URL and download the Composer-Setup.exe file. Download Composer from the following link

https://getcomposer.org/download/

4. Install Laravel

Now, install Laravel 5.7 or above using composer. Open the command prompt and run the following command.

composer global require "laravel/installer"

5. Creating a Laravel Application

After successful installation of Laravel 5.7, Create a new project called MyFirstLaravelProject.

composer create-project --prefer-dist laravel/laravel MyFirstLaravelProject

6. Create a Database

Create a database in MySQL server. Open the link below in a web browser. 

http://localhost/phpmyadmin 

Provide Credentials (Enter username and password. By default, the username will be root password will be empty)

Create a database, and its tables

7.  Modify ENV File

Open an .env file present inside the root directory of MyFirstLaravelProject directory. Enter Database details.

DB_DATABASE=(MyFirstLaravelProject-db)

DB_USERNAME=(By Default: root)

DB_PASSWORD=(By Default, empty)

7. Migrate Database

Migrate the database to the local database using the command below.

php artisan migrate

8. Running the Application

Our application can be run using the command below.

php artisan serve

Open the link generated, this is first page of our Laravel application.

http://localhost:8000