How to install Laravel

What is Laravel?

Laravel is a web application framework with expressive, elegant syntax. It is an open source PHP based framework. It uses the commonly  known MVC (model-view-controller) architectural pattern. The key features of Laravel are a modular packaging system with a dedicated dependency manager, different ways for accessing relational databases, utilities that aid in application deployment and maintenance, and its orientation toward syntactic sugar (easy to rea, sweet to the eyes of the programmer).

Laravel uses the powerfull yet easy to use Blade templating engine to render views. It has support out of the box for authentication systems and it is capable of working alongside any front-end framework like Vue or React.

How to install it

Before moving onwards, make sure you have the latest PHP version installed on your system. You can read one of our previous articles to learn how to do that.

Depending on your operating system there are a few ways to install Laravel and get started. Here is the simplest way, using composer:

For managing dependencies, Laravel uses composer. Make sure you have a Composer installed on your system before you install Laravel. In this article, you will see the installation process of Laravel and composer.

Follow each step below to install it:

Step 1 − Visit the following URL and download composer to install it on your system.

https://getcomposer.org/download/

or a more complete documentation and an expanded list of operating systems, visit: https://getcomposer.org/doc/00-intro.md

Step 2 − After Composer is installed, check the installation by typing the Composer command in a new terminal window (command prompt)

Step 3 - Create a new folder dedicated to your projects, open that folder in a terminal window and type in the following commands:

composer create-project laravel/laravel PROJECT-NAME-HERE
cd PROJECT-NAME-HERE
php artisan server

 

Now if you visit localhost:8000 in your browser, you will see your new Laravel project up and running.

Next up is time to dig into coding. Laravel's project folder structure is easy to understand and easy to keep your code organized. All of the logic, including models, controllers, middlewares, https requests are contained in the /app folder. Routing, including api routes, are inside the /routes folder. Views, and other front-end related files are inside the /resources folder.

 

Leave a comment

Please note, comments need to be approved before they are published.