Differences and Similarities Between Lumen and Laravel

Differences and Similarities Between Lumen and Laravel

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

  • Documentation (especially the introduction)
  • Article from Matt Stauffer
  • Interview with Taylor Otwell (especially the last question)
  • Reddit discussion
  • Laracast: Introducing Lumen

What is the difference between laravel and lumen

Laravel is doing quite a lot of initialization during each request. With Lumen processing each request is much faster so it is supposed to be able to handle even more load than Laravel with all its caching.

This means that Lumen is less configurable but is able to handle more requests per second.

Is there a lib for laravel or lumen 8 to handle filtering for any table?

I'm happy to announce that there is such a library now. But it is not public (and maybe will never be with this kind of attitude towards "magic"). If the laravel/lumen community is curious about it, lets talk.

Key features:
Crud REST operations including filtering capabilities (by any column) over max 9 tables via laravel/lumen relations (including these ones How to create Laravel 8 custom relation HasManyThrough 2 and 3 Link Tables so involving 4 or 5 tables in total?). Filtering includes: in, not in, starts with, contains, from, to, is null,is not null, multi-sorting filters on the resource's relations etc.

It can be used together with https://github.com/jarektkaczyk/eloquence/wiki/Mappable to not expose column names from db to FE.

PS. May I remind you that the question was: "Is there a lib for laravel or lumen 8 to handle filtering for any table?" So the answer is: YES there is (this PS if just for haters).



Related Topics



Leave a reply



Submit