confusion
I have never been able to understand the difference between Lumen and Laravel very friendly, I only know that they are The two PHP frameworks are very similar, and the usage methods are almost 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.
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 Making the entire framework more lightweight and faster
Laravel should be regarded as a full-stack framework, and lumen is purely used for developing back-end services.
● The definition of lumen is a streamlined version of laravel. You can remove some components and things of laravel 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?
For more laravel related technical articles, please visit the laravel framework introductory tutorial column to learn!
The above is the detailed content of The difference between lumen and laravel. For more information, please follow other related articles on the PHP Chinese website!