How to Install and Configure your first Laravel Application

In this lesson, you will learn how to create your first Laravel project.

Benny
Bina Nusantara IT Division
4 min readJun 30, 2022

--

Currently Laravel is quite popular among web application development circles. Laravel has been widely used in various types of needs such as dashboards, e-commerce, blogs, job sites, and others. So, let’s get started with creating our first Laravel project.

What is Laravel?

Laravel is an open-source PHP framework, which is robust and easy to understand. It follows a model-view-controller design pattern. Laravel reuses the existing components of different frameworks which helps in creating a web application. The web application thus designed is more structured and pragmatic.

If you are familiar with Core PHP and Advanced PHP, Laravel will make your task easier. It saves a lot time if you are planning to develop a website from scratch. Moreover, a website built in Laravel is secure and prevents several web attacks.

Getting Started

Before you can create a new Laravel project, you need to first check and make sure that you have PHP and Composer installed on your system.

Check your PHP and Composer version by running this command in your Command Prompt/Terminal.

If you can’t find your version of PHP and Composer then you need to install it first.

Install PHP

To install PHP you can get it from XAMPP, therefore you need to install XAMPP first.

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

You can choose the XAMPP installer with a minimum PHP version of 7.4.29.

After you download the installer, you can directly install it and follow the instructions.

XAMPP Control Panel

After XAMPP is installed on your system, PHP will also be installed on your system.

Install Composer

To install Composer on your system, you need to first download the installer on the official website.

https://getcomposer.org/download/

After you download the installer, you can directly install it and follow the instructions.

The PHP command-line will be filled in automatically if you have previously installed PHP using XAMPP. So you can leave it filled by default.

Your First Laravel Project

After you have installed PHP and Composer, you may create a new Laravel project via the Composer command:

composer create-project laravel/laravel your-app-name

The process will take a long time because in this process Composer will download all the package files needed for your Laravel project.

After the download is complete, you can immediately run your first laravel project using the Artisan command. Before that you first go into your Laravel project folder, in my case it is “benny-laravel-app”.

cd benny-laravel-app

Once you are in your project folder, you can immediately run the following Artisan command:

php artisan serve

And congratulations!!! Your first Laravel project is running successfully. Now you can enter the url address to open your Laravel website in your browser. By default it is usually http://127.0.0.1:8000/

Conclusion

The method above is how to create a Laravel project using Composer. There is actually another way to build your Laravel project from scratch. However, I personally use Composer more often to create new Laravel projects because it’s easier in my opinion. So it’s very easy if we want to create a website using Laravel.

--

--