📜 ⬆️ ⬇️

Lumen - a new PHP microframe 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, wrote on his twitter that besides Laravel he was preparing to release something else that, of course, intrigued subscribers.
')

I did not have to wait long. A week later, Lumen was introduced, a microframe based on Laravel components. Why is it 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 pure framework on a disk is about 10 MB. Not so small! However, this does not prevent him from being called “micro”, since “micro” is not only size.

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

Routing is based on the FastRoute library, which allows it to be quite quick.
Taylor says the speed is higher than that of the microframework Slim, and even more than that of Silex.



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

The Lumen syntax is classic for PHP microform:

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

Controller classes are also supported:

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

More code in the Lumen documentation section .

Conclusion


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

Source: https://habr.com/ru/post/255785/


All Articles