Introduction to Lumen Framework

Tram Ho

Lumen is a PHP framework developed by Laravel’s father – Taylor Otwell. According to the author, Lumen has no intention of replacing Laravel. In fact Lumen was created to be a microservices system – a smaller system to support large systems like Laravel.

In this article, I do not want to go too deep into Lumen, I just want to introduce the basics of this Framework. Let’s start

1.The highlights of Lumen

Efficiency

The purpose of Lumen was created to develop microservice system so the speed is very appreciated. On the other hand, replacing Symfony router with Fast Router – a router library developed by Nikita Popov, also improved the performance.

Lumen performance compared to other micro-frameworks

Convenience

Because Lumen is built from Laravel’s Core, this framework also inherits a lot from Laravel such as: Eloquent, caching, queues, validation, routing, middleware, and container services.

However, to ensure performance, Lumen has omitted many components of Laravel, you should consider this issue when starting a Lumen project.

The good news is that you can switch from Lumen to Laravel Framework in just a few simple steps.

2.Install Lumen and run your first application

Configuration

As of now, the latest version of Lumen is the 7x version. To install, your server must meet the following requirements:

  • PHP Version> = 7.2
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension

Create project

Like Laravel, Lumen is installed via Composer. If you have not installed the Composer can also be installed at this

Install Lumen with the following command:

After all the installation is completed, you can run the project immediately with the command:

Configuration

You can configure your Project Lumen via the .env file. You can also Custom third-parties in this file.

3. Finish

In short, Lumen is a framework built from the source code of Laravel. The purpose of Lumen is to develop microservices, supporting large systems.

The article is referenced from:

This article is already on my personal blog, you can view it here

Share the news now

Source : Viblo