Answer the question
In order to leave comments, you need to log in
Which is better Laravel or Lumen for REST API?
And so, we need a universal backend API for frontend ReactJS and native android, ios.
Important criteria: oauth, registration, authorization, permission roles, mailing, pagination
First I started developing on Lumen, installed the necessary packages (flipbox/lumen-generator, dusterio/lumen-passport, dingo/api, barryvdh/laravel-cors) and wondered if I turned it into Laravel in fact, and will it be enough for me? Because I will need to do email newsletters, which means I also need to fasten the blade. Besides, someone wrote that dingo/api is a bad thing.
Then I decided to try to do it on Laravel. I immediately rolled ReactJS through mix laravel. I had to install only laravel/passport, also change class Handler extends ExceptionHandler so that errors are returned in json format. And everything else to change .. and then I wondered - is it right that I switched to laravel? There is a feeling that 90% of the features will not be used, such as sessions, web part, etc. and therefore in vain to drag each time in the project and litter.
And here I am again in limbo, on what to continue to do. Yes, I could do everything on any blunder, but I want to competently and determine a good architecture for myself.
Please do not answer in this form: "do it on laravel" or "do it on lumen". I want to see reasoned answers and your experience.
Answer the question
In order to leave comments, you need to log in
which means you also need to fasten the bladeDoes not mean.
Besides, someone wrote that dingo/api is a bad thing.Nobody forces you to use it if it is a bad thing.
but I want to competently and define a good architecture for myself.A good architecture starts with setting specific tasks and requirements, and at the moment you don't have any specific requirements at all - you can do it on anything, any option is suitable for these conditions.
reasoned answers and your experience.My experience tells me that Lumen was originally conceived for maximum speed, which is usually important when writing services such as various REST / API servers, especially when they are heavily loaded.
and therefore in vain to drag each time in the project and litterUsually, what you call "garbage" lies in those folders that the programmer, by definition, is not supposed to climb into. But, if you put the question in this way, then "garbage" will be in any case, regardless of the choice of framework.
That is why Symphony 4's approach rules. You select only those components that you need.
You need to decide which priority is to write quickly (Laravel) or imaginary performance (Lumen)
At one time I also tried both options and it seemed to me that commenting out unused parts in Laravel is faster than writing missing packages and configs in Lumen
"break not build"
I am a person from 2021. If you write a microservice or just rest, use lumen, they removed a lot of what is needed in the monolith from it and changed some mechanics that are more convenient for the rest-api. For example, the validator on errors no longer redirects you, but returns validation errors to the client in json format. In general, lumen is the choice for microservices, and laravel for monoliths. Although you can write microservices in laravel.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question