Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
309 views
in Technique[技术] by (71.8m points)

php - Differences and Similarities Between Lumen and Laravel

I read the documentation and it seems Lumen is Laravel with less features. I must be missing something. I am looking for a comparison table of the components and features of both Laravel and Lumen. Does anyone know the differences?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Update (5.2)

With the latest version of Lumen (5.2) the Microframework focuses on Stateless APIs.
The documentation states:

Lumen 5.2 represents a shift on slimming Lumen to focus solely on serving stateless, JSON APIs. As such, sessions and views are no longer included with the framework. If you need access to these features, you should use the full Laravel framework.


Original answer (<= 5.1)

Lumen is all about speed. It's faster and can handle more requests per second than Laravel.

Laravel is a framework that glues together a lot of components (3rd party and Laravels own components). Now Lumen makes use of a lot of the same components, but strips down the bootstrapping process to a minimum. You could say it is a "different glue", the components (and therefore a lot of the features) are mostly the same.

The performance improvement is achieved by taking away some of the flexibility of the framework in terms of configuration and altering the default boot process.

Besides that, more features are disabled by default and have to be activated before they can be used. As an example: Facades (like DB::table())
You first need to uncomment this line in bootstrap/app.php to enable them:

// $app->withFacades();

The same goes for Dotenv environment files and Eloquent.

For routing Lumen uses nikic/FastRoute instead of symfonys router because it performs a lot better and gives the micro-framework another big boost.

Other than that pretty much everything is the same as in Laravel.

Good reads on Lumen


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...