0% found this document useful (0 votes)
135 views12 pages

Web Technologies Week 08 (Laravel and VS Installation)

The document provides instructions for installing Laravel, Visual Studio Code, and setting up a database connection on a local development environment. It includes steps to install XAMPP, Composer, Laravel using Composer, and Visual Studio Code. It also covers creating a database in the local MySQL server and configuring the .env file to connect the Laravel application to this database.

Uploaded by

Imran Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views12 pages

Web Technologies Week 08 (Laravel and VS Installation)

The document provides instructions for installing Laravel, Visual Studio Code, and setting up a database connection on a local development environment. It includes steps to install XAMPP, Composer, Laravel using Composer, and Visual Studio Code. It also covers creating a database in the local MySQL server and configuring the .env file to connect the Laravel application to this database.

Uploaded by

Imran Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Created by: Dr.

Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

Installations (Laravel & Visual Studio Code)


Part 1: Laravel Installation
Step 1: Install XAMPP on your computer using the following URL

Latest Laravel version depends on the PHP version which is automatically installed during XAMPP
installation.

URL: https://www.apachefriends.org

- To download, click XAMPP for Windows


- After downloading XAMPP, open the setup, press Next button to start installation

1
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- After successful installation, XAMPP Control Panel would look like below.

2
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

Step 2: Install composer program using the following URL

Laravel needs composer to manage different extensions

URL: https://getcomposer.org/download/

- Run composer.exe after download. During installation, if you are prompted for php.exe path, its
address in your system is xampp/php by default.

3
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- Once composer has been installed, test it by typing the command composer in the command
prompt (cmd). It will display composer version which is version 2.0.7 in my case.

4
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

Step 3: Install Laravel (locally)

In global installation, Laravel is only installed once and then it is used for each new Project. In local
installation, Laravel is installed for each new Project. Use the following URL to understand local and
global installation of Laravel.

URL: https://laravel.com/docs/7.x/installation

We shall use local installation which means Project-wise Laravel installation.

- Type following commands in the Command Prompt to create a folder CRUD and install Laravel in
this folder. The name of our Laravel Project is CRUD.

1. cd c:\xampp\htdocs
2. composer create-project --prefer-dist laravel/laravel FA20_Student_MIS

5
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- After few minutes, Laravel will be installed successfully as shown below.

- Laravel has been successfully installed in the project folder FA20_Student_MIS


- After installation, type the following commands in the Command Prompt to go the
FA20_Student_MIS folder and start there the PHP development server, for development and
testing.
1. cd FA20_Student_MIS
2. php artisan serve

6
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- Now, open the browser and type one of the following in the addresses bar to start the Laravel
application

1. http://127.0.0.1:8000
2. http://localhost/FA20_Student_MIS/public/

Part 2: Microsoft Visual Studio Code (VS Code) Installation

Step 1: Download VS Code from the following URL.


URL: https://code.visualstudio.com/download

7
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- After Successful installation, Open Laravel project using VS Code using one of the TWO
methods.

1. Using right-click on the project folder in htdocs

8
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

2. Using Open Project option of VS Code editor

9
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- Laravel project will look in VS Code as shown below

Part 3: Creating a Database in MySQL and linking with Laravel Application

- Open XAMPP MySQL as shown in the image below.

10
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- Create a new database in your XAMPP MySQL

- Once the database is created, we need to tell our Laravel project the details about the
database.

11
Created by: Dr. Maaz Rehan CSC336 Web Programming COMSATS University Islamabad, Pakistan

- Modify the following property in your .env file according to your database name. MY
database name is fa20_student_mis.

***

12

You might also like