Lumen - a new PHP microframework from the developer Laravel



Hello!

Just a few days ago, Taylor Otwell, the developer of the widely known and probably the most popular Laravel framework in the Western world, tweeted that besides Laravel he was preparing something else to release, which, of course, intrigued subscribers.


I did not have to wait long. A week later, Lumen , a microframework based on Laravel components, was introduced . Why is it so called - "Lumen"? Because the components of Laravel, as you know, are called Illuminate.

What is this framework? Let's get a look.

composer create-project laravel/lumen --prefer-dist

The size of a clean disk framework is about 10 MB. Not so small! Nevertheless, this does not prevent him from being called “micro”, since “micro” is not only the size.

Inside are Laravel 5 components. Eloquent models, Auth authorization, Blade templates, as well as validation, cache, middleware, DIC and more.

Routing is based on the FastRoute library , which allows it to be pretty nimble.
Taylor claims a speed higher than that of the Slim microframework, and even higher than Silex.



The third version of Slim, which has not yet been released, but is being prepared slowly, is also written on the FastRoute router.

The Lumen syntax is classic for PHP microframes:

$app->get('user/{id}', function($id) {
    return User::findOrFail($id);
});

Class controllers are also supported:

$app->get('user/{id}', 'UserController@showProfile');

More code in the Lumen documentation section .

Conclusion


Well, another microframework? Yes sir. But I guess it will not get lost among the mass of other frameworks and will be very popular. Taylor has all the power to do this. If he remains unharmed , of course.

Also popular now: