I have checked there is a difference in lumen btw. We don't have models in lumen but we can add model class in route.php and we can use them. we also can use controller but what if we need to call a model in controller. We have route.php file we can do everything here, but why we need controller then etc, i have lots of confusion regarding this. Can anyone explain me better.
Thanks for reply actually guys I know about this. My actual confusion why we need to create model class in route.php why we need to right logic in route instead of controllers. Any idea. I mean we can do anything in route.php then why we need MVC structure for lumen.
@adilsaeed31 it's the fundamental purpose of mvc pattern. A quick Google search will explain it better as it's well documented pros and cons. Laravel offers freedom to do what you want so you don't have to stick to the "rules" of mvc. I know devs, including myself test functions, queries, browser test and play around and will establish a class model and call it directly in the routes file. I personally wouldn't deploy code that way. But that choice is yours to make.
@martinbean thanks for answers, you are right, we should use routes as for routings however we have controllers n models n middleware. The programmers definitely need to stick with framework standards.
That's right laravel gives us freedom in routes.php file to do anything. However what I'm thinking is lumen should have this kind of freedom instead of laravel, because lumen is micro framework specially for api's n web services and Laravel is full framework for a complete huge level applications.