Home>Article>PHP Framework> Do you know the difference between Lumen and laravel?

Do you know the difference between Lumen and laravel?

藏色散人
藏色散人 forward
2021-01-07 15:43:16 2449browse

The following columnLaravel Tutorialwill introduce to you the difference between Lumen and laravel. I hope it will be helpful to friends in need!

confusion

I have never been able to understand the difference between Lumen and Laravel very friendly. I only know that they are two very similar PHP frameworks, how to use them, etc. Pretty much the same.

Why do we need to answer questions

Recently I took over a project of the company, which has a special back-end management system and a special system for front-end calls (that is, API) ! This is a project.

Sure enough, the backend management system is written using the Laravel framework, and the API is written using the Lumen framework. This makes me want to laugh. Wouldn’t it be enough to unify and use the same framework? However, We cannot change history. All we can do is change ourselves to make ourselves more suitable for these two frameworks.

Look down

Lumen is a streamlined version of Laravel! If you check in with your bags, it’s Laravel. You need to buy pots and pans, and if you check in with your bags, it’s Lumen.

Generally speaking, it is recommended to use Lumen to develop API servers, and use Laravel to develop web pages.

When you don’t know how to choose, use Laravel.

Do you know the difference between Lumen and laravel?

Also maintain Lumen in the Laravel community.

Questions and Answers from Netizens

lumen is specifically designed for developing APIs or services. For example, it removes the dependence on developing web pages and other targeted changes. The purpose is to make The entire framework is more lightweight and faster.

Laravel should be regarded as a full-stack framework. Lumen is purely used for developing back-end services.

The definition of lumen is a streamlined version of laravel. You can add some components of laravel Remove it and turn it into lumen, or you can upgrade lumen to laravel. There is no contradiction in this, just call it this way if you want. Defining a word to summarize the streamlined laravel is easier to distinguish.

I have long heard that the former is a lightweight version of the latter framework, but I read the document carefully and found that the former is nothing more than the latter with the view and some components removed.

If that's the case, why don't I use laravel directly, and then remove the unused components in the service provider, and when the controller returns, it only returns json data instead of the view? Why do we need to create a separate framework?

Summary

Just understand! Anyway, I only go out for shopping occasionally!

The above is the detailed content of Do you know the difference between Lumen and laravel?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jianshu.com. If there is any infringement, please contact admin@php.cn delete